Discord bot role functions do not work

Hi, so I’m not getting errors at all or anything but I think it might be this. It can send messages but nothing with roles and ALL my other bots are working EXCEPT this one.

proj name = wat-amb-bot

i’ve tried everything its’ just the role methods that aren’t working.i even tried giving it a token of a bot that works compeltely and its not working. so i think its glitch’s probelm.

Hi @miramallows I’ve moved this to a new topic since it doesn’t have anything to do with the “something took too long to do” error (as you’ve said, you’re not seeing any errors).

Based on the fact that your bot is working fine except one specific set of functions, my guess is that your bot’s not asserting the correct permission set. If you look up your bot in the Discord developer portal (the url will be something like https://discordapp.com/developers/applications/{application_id}/bots) at the bottom you’ll see a section for Bot Permissions. Take a look at those and make sure you’re asking for everything you want your bot to be able to do.

Hope this helps!

I’m pretty sure it has enough permissions. I even tried switching the entire token over to another bot application which previously worked with similar code.

As i mentioned in

Basically, this is what usually happens:
bot1 on glitch – bot application called abc
bot2 on glitch – bot app called xyz

both apps have enough permissions.

tried to run same code on bot2 with xyz => worked.
tried to run same code on bot1 with abc => didnt work.
tried to run same code on bot1 with xyz token => didn’t work.

so… yeah obviously its not a permission problem. ive investigated for over 5 hours on it and i dind’t get a single error. if its permsisions error it would give Discord API: Missing Permissions error; it didn’t.

hence i cameto the conclusion that it’s glitch’s problem.

Okay fab, bot2 running on xyz wont’ work too now.

I won’t mark glitch the culprit until i’m sure, and I’m pretty sure it’s glitch cuz everyone else running the same code is fine. I even tried evaluating a simplified version of the code. Didn’t work, no errors. Working for others.

ok idk why but it suddenly fixed itself

haven’t even edited any code

if one of you guys pulled strings, thx lol

Hi @cori it’s not working again :joy:

I have the same issues with role methods: discord.js, all permissions, no error. Bot can create a role, but can’t change color, name or delete it. It’s very random, one day it is working all fine and in the other day it’s not working. I really don’t know what is the root of this problem.

Hey @Szonszczyk, welcome to the Glitch forum!

Can you capture the response from the Discord API when you try to do the actions that don’t work? Even if it’s not an error perhaps we can ascertain what’s going on from what the Discord API tells us.

@miramallows if you’re seeing the same sort of behavior, can you look at doing the same thing?

In either case, if you need some help setting that up, if you can provide the specific methods in your project that don’t work (maybe even a link to the line of code that breaks) we can try to take a look and help sort out how best to investigate what’s happening.

Thank you for your response cori and I am sorry for not responding for so long. Everything worked just fine until a few days ago.
My 2 bots that I have on glitch have the same error that I mentioned in previously post.
However, when I used same function that wasn’t working on glitch and run them at my friends server but using same bot token that I use in glitch, it worked.
I must confirm that this is glitch problem, but I have bad feelings that this problem is caused by users that are trying to do “rainbow role color” that is against discord ToS.

I can’t capture any response from API because there is no response from API…

Can you invite me to your project so I can take a closer look at this and maybe help you find out of this actually is a problem with glitch or an error that you may not notice

@Szonszczyk you say that your bot on Glitch can create a role but not, for example, change its name, and that you don’t receive an error message when you try; it that correct?

So it’s able to use https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=createRole but not https://discord.js.org/#/docs/main/stable/class/Role?scrollTo=setName?

Yes. It doesn’t work lol

It sometimes works tho

@miramallows did you resolve the promise and can you show me how did you do it and did you catch the error

It sometimes works, sometimes doesn’t. There’s no error. I tried resolving promise it’s glitch’s issue

1 Like

oh OK. I think you are right.

Sorry for not responding for so long, but I moved this function out of my glitch project and it is working so I didn’t need any further help with it.

I think discord is banning certain functions of bots from glitch (I call this a “soft ban”). Yesterday I found that the changing “displayName” is not working (missing permissions error even when the bot has administration privileges) so I moved it from glitch to my friends server and it is working again.