discord-tickets / bot

The most popular open-source and self-hosted ticket management bot for Discord - a free alternative to the premium and white-label plans of other popular ticketing bots.
https://discordtickets.app
GNU General Public License v3.0
898 stars 473 forks source link

[BUG] DiscordAPIError[50013]: Missing Permissions #454

Open Netherwhal opened 1 year ago

Netherwhal commented 1 year ago

Is there an existing issue for this?

Current Behavior

 01/07/23 23:37:42  [ERROR] DiscordAPIError[50013]: Missing Permissions
    at handleErrors (/home/container/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:640:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SequentialHandler.runRequest (/home/container/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:1021:23)
    at async SequentialHandler.queueRequest (/home/container/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:862:14)
    at async REST.request (/home/container/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:1387:22)
    at async Guild.fetchAuditLogs (/home/container/node_modules/.pnpm/discord.js@14.11.0_bufferutil@4.0.7_utf-8-validate@5.0.10/node_modules/discord.js/src/structures/Guild.js:759:18)
    at async module.exports.run (/home/container/src/listeners/client/messageDelete.js:33:21) {
  requestBody: { files: undefined, json: undefined },
  **rawError: { message: 'Missing Permissions', code: 50013 },**
  code: 50013,
  status: 403,
  method: 'GET',
  url: 'https://discord.com/api/v10/guilds//audit-logs?limit=1&action_type=72'

seems like a race condition? Does not always happen and things still work.

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Node:
- NPM:
- Bot:

Anything else?

No response

RooRay commented 1 year ago

Are you sure this isn't an issue with the permissions you have assigned the bot in your Discord server? If not please give steps to reproduce

Netherwhal commented 1 year ago

It happens intermittent, hence why I think race condition. Otherwise it works so perms are there

eartharoid commented 1 year ago

https://discordjs.guide/popular-topics/permissions-extended.html#missing-permissions still have no idea