ilovecherries / discord-sbs-bridge

SmileBASIC Source Chat Bridge for Discord
MIT License
2 stars 1 forks source link

The process exits when attempting to send messages to deleted channels #11

Open ilovecherries opened 2 years ago

ilovecherries commented 2 years ago

The URL /channels/807814949665374209 doesn't lead to any channel, so it must be assumed that it was deleted.

/app/node_modules/discord.js/src/rest/RequestHandler.js:172
        throw new HTTPError(error.message, error.constructor.name, error.status, request);
              ^

HTTPError [AbortError]: The user aborted a request.
    at RequestHandler.execute (/app/node_modules/discord.js/src/rest/RequestHandler.js:172:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at runNextTicks (node:internal/process/task_queues:65:3)
    at processTimers (node:internal/timers:497:9)
    at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
    at async TextChannel.send (/app/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:171:15) {
  code: 500,
  method: 'post',
  path: '/channels/807814949665374209/messages',
  requestData: {
    json: {
      content: 'There was an error sending a message to Discord!',
      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
    },
    files: []
  }
}
ilovecherries commented 2 years ago

37ff813f998c11171e8a25ef209bce96a4d9b425 might solve this? I'll see if it reaches the edge case again at some point. I'll consider it solved if it doesn't happen for a month.