Missing permissions causes crash #4

Closed
opened 2023-08-04 16:52:08 +00:00 by voidf1sh · 1 comment
Owner
node:events:491
      throw er; // Unhandled 'error' event
      ^

DiscordAPIError[50013]: Missing Permissions
    at handleErrors (/usr/src/app/node_modules/@discordjs/rest/dist/index.js:640:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SequentialHandler.runRequest (/usr/src/app/node_modules/@discordjs/rest/dist/index.js:1021:23)
    at async SequentialHandler.queueRequest (/usr/src/app/node_modules/@discordjs/rest/dist/index.js:862:14)
    at async REST.request (/usr/src/app/node_modules/@discordjs/rest/dist/index.js:1387:22)
    at async TextChannel.send (/usr/src/app/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:162:15)
    at async /usr/src/app/main.js:108:5
    at async Client.<anonymous> (/usr/src/app/main.js:105:2)
Emitted 'error' event on Client instance at:
    at emitUnhandledRejectionOrErr (node:events:394:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
  requestBody: {
    files: [],
    json: {
      content: "</compare:0> - This is awkward, I've lost my own comparison message!",
      tts: false,
      nonce: undefined,
      embeds: undefined,
      components: undefined,
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined,
      thread_name: undefined
    }
  },
  rawError: { message: 'Missing Permissions', code: 50013 },
  code: 50013,
  status: 403,
  method: 'POST',
  url: 'https://discord.com/api/v10/channels/*redacted*/messages'
}
``` node:events:491 throw er; // Unhandled 'error' event ^ DiscordAPIError[50013]: Missing Permissions at handleErrors (/usr/src/app/node_modules/@discordjs/rest/dist/index.js:640:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async SequentialHandler.runRequest (/usr/src/app/node_modules/@discordjs/rest/dist/index.js:1021:23) at async SequentialHandler.queueRequest (/usr/src/app/node_modules/@discordjs/rest/dist/index.js:862:14) at async REST.request (/usr/src/app/node_modules/@discordjs/rest/dist/index.js:1387:22) at async TextChannel.send (/usr/src/app/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:162:15) at async /usr/src/app/main.js:108:5 at async Client.<anonymous> (/usr/src/app/main.js:105:2) Emitted 'error' event on Client instance at: at emitUnhandledRejectionOrErr (node:events:394:10) at process.processTicksAndRejections (node:internal/process/task_queues:84:21) { requestBody: { files: [], json: { content: "</compare:0> - This is awkward, I've lost my own comparison message!", tts: false, nonce: undefined, embeds: undefined, components: undefined, username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined, thread_name: undefined } }, rawError: { message: 'Missing Permissions', code: 50013 }, code: 50013, status: 403, method: 'POST', url: 'https://discord.com/api/v10/channels/*redacted*/messages' }
Author
Owner

main.js:108: await message.channel.send(strings.error.noCompareMessage);
messageUpdate - updateHandler - catch - switch(e) - noCompareMessage

Solution: catch this message.send

Additional: check and catch all other message.sends

`main.js:108`: `await message.channel.send(strings.error.noCompareMessage);` messageUpdate - updateHandler - catch - switch(e) - noCompareMessage Solution: catch this message.send Additional: check and catch all other message.sends
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: voidf1sh/silvanus#4
No description provided.