I am getting error when someone joins. I created a bot for college to assign a role according to their names. But I am getting error of Missing Permissions. Below is error which i am getting. Help me with it.
(node:6660) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at RequestHandler.execute (C:\Users\hamza\Desktop\bot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:6660) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a
catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6660) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
1
votes
I have given administrator role to my bot.
– Hamza Khursheed
1 Answers
1
votes
As stated in the Discord.js Guide, giving your bot administrator permissions doesn't allow it to bypass role hierarchy.
The
ADMINISTRATOR
permission being granted does not skip any hierarchical check!
The most basic solution would be to drag your bot's role above all other roles and give it the Manage Roles
permission. Another solution to this issue would be you giving the bot a role higher than the role it is assigning with Manage Roles
permissions