Discord bot role functions do not work

#1

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

0 Likes

Discord Ban mega-thread! (Discord bot / Something took too long to do)
#2

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.

0 Likes

#3

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!

0 Likes

#4

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.

0 Likes

#5

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.

0 Likes

#6

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

0 Likes

#7

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.

0 Likes

#8

ok idk why but it suddenly fixed itself

haven’t even edited any code

if one of you guys pulled strings, thx lol

0 Likes

#9

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

0 Likes

#10

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.

0 Likes

#11

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.

0 Likes

#12

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…

0 Likes

#13

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

0 Likes

#14

@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?

0 Likes