SinisterRectus / Discordia

Discord API library written in Lua for the Luvit runtime environment
MIT License
688 stars 144 forks source link

403 - FORBIDDEN #402

Closed 0Q1BE closed 8 months ago

0Q1BE commented 8 months ago

Hi, I'm writing an verification bot for my server and after I ended with suffering with code I found new problem "403 - FORBIDDEN". I didn't expect to meet this thing because I gave my bot administrator permissions, but even this didn't work. image image What's the matter?

Bilal2453 commented 8 months ago

If you are getting 403 forbidden error also know as missing permissions while patching/moderating other members (using methods like :setNickname, :removeRole, :kick), even when your bot does have admin permissions, this might mean the bot's role is 'physically' lower than or equal to the member's role you're trying to patch. In this screenshot the Bot role has higher permissions than the Member role, but the member is above Bot, which means when a bot that has Bot role tries to edit (like kicking) a member who have member role, the bot will fail with 403 http error, you can simply fix this by moving up the Bot role, just drag it above the member role, the same problem might happen when a bot tries to patch the server owner member, which can't be done even if its role is higher.

image

Please for questions like this, you can ask in our Discord server or at our channel in the Discord API server.

0Q1BE commented 8 months ago

So, in this picture there is a 403 problem (green is role that is adding) image And in this picture there isn't? image

0Q1BE commented 8 months ago

And it worked!

0Q1BE commented 8 months ago

thx very much