DiscordAPIError: Missing Permission

I get this error in my logs:

DiscordAPIError: Missing Permissions

(node:629) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions

at item.request.gen.end (/rbd/pnpm-volume/8a278c4b-b94f-4d44-9a10-8320b52718c3/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15)

at then (/rbd/pnpm-volume/8a278c4b-b94f-4d44-9a10-8320b52718c3/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)

at process._tickCallback (internal/process/next_tick.js:68:7)

(node:629) 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(). (rejection id: 15)

(node:629) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions

at item.request.gen.end (/rbd/pnpm-volume/8a278c4b-b94f-4d44-9a10-8320b52718c3/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15)

at then (/rbd/pnpm-volume/8a278c4b-b94f-4d44-9a10-8320b52718c3/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)

at process._tickCallback (internal/process/next_tick.js:68:7)

(node:629) 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(). (rejection id: 19)

(node:629) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions

at item.request.gen.end (/rbd/pnpm-volume/8a278c4b-b94f-4d44-9a10-8320b52718c3/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15)

at then (/rbd/pnpm-volume/8a278c4b-b94f-4d44-9a10-8320b52718c3/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)

at process._tickCallback (internal/process/next_tick.js:68:7)

(node:629) 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(). (rejection id: 23)

Error with Event “Clear reactions from message”, Action #51:

DiscordAPIError: Missing Permissions

The bot is created with Discord Bot Maker so I am not good how to fix and solve issues.
Ty if you helping me.

1 Like

Hey @Lillishaj2!

During your bot development you will likely run into DiscordAPIError: Missing Permissions at some point. This error can be caused by one of the following reasons:

  • Your bot is missing the needed permission to execute this action in it’s calculated base or final permissions (requirement changes based on the type of action you are trying to execute).
  • You provided an invalid permission number while trying to create overwrites. (The calculator on the apps page returns decimal values while the developer documentation lists the flags in hex. Make sure you are not mixing the two and don’t use the hex prefix 0x where not applicable)
  • It is trying to execute an action on a guild member with a role higher than or equal to your bots highest role.
  • It is trying to modify or assign a role that is higher than or equal to its highest role.
  • It is trying to execute a forbidden action on the server owner.
  • It is trying to execute an action based on another unfulfilled factor (for example reserved for partnered guilds).
  • It is trying to execute an action on a voice channel without the VIEW_CHANNEL permission.

Good Luck & Happy Glitching!

3 Likes

It’s trying to remove reactions from the bot’s own reactions that he have added.

Mine is giving this error:
(node:1119) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(node:1119) UnhandledPromiseRejectionWarning: DiscordAPIError
at item.request.gen.end (/rbd/pnpm-volume/2d8435da-1418-47f9-820b-f3c5fac83e24/node_modules/.registry.npmjs.org/discord.js/11.6.4/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15)
at then (/rbd/pnpm-volume/2d8435da-1418-47f9-820b-f3c5fac83e24/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1119) 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(). (rejection id: 3)
(node:1119) [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.

How do I fix it?

You can’t, it’s a deprecated feature, the only way to solve it is to upgrade to a more recent version of the library/package youre using

Thank you veeery much! :smiling_face_with_three_hearts: My issue was that the bot role was lower than the user role to give

Hi, I made a discord bot and when I done the ban command, I had a few issues, but i feed them, but my main issue if someone with a higher rank than my bot try’s to ban someone else with a role higher than my bot. it comes up with the error. how do I stop it or make it so that it doesn’t come up with and error and message in that discord channel that they cannot ban that person.

Hi @bobrossrtx!
Try adding this to the ban code

.catch(error =>
    message.reply(
      `Sorry ${message.author} I couldn't ban because of : ${error}`
    )
  );

(code from Issue with a Discord.js command giving Internal Error)

2 Likes

this helped me so muchh

Hey everyone. Just remember, replies you send in a topic notifies everyone who has sent a reply. This could annoy people. So I recommend that you either don’t reply, like, or start a new topic. Thank you and good day/night.

DiscordAPIError: Missing Permissions
at RequestHandler.execute (C:\Users\Kovzp\OneDrive\Desktop\DiscordBot\node_modules\discord.js\src\rest\RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (C:\Users\Kovzp\OneDrive\Desktop\DiscordBot\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async GuildBanManager.create (C:\Users\Kovzp\OneDrive\Desktop\DiscordBot\node_modules\discord.js\src\managers\GuildBanManager.js:143:5) {
method: ‘put’,
path: ‘/guilds/933506815415685161/bans/637471451821113349’,
code: 50013,
httpStatus: 403,
requestData: { json: { delete_message_days: undefined }, files: }
}