DeguSec / R-AI

Creative Commons Attribution Share Alike 4.0 International
2 stars 0 forks source link

Bot bugs out for some reason when sending a message sometimes. #21

Closed Rijndael1998 closed 1 year ago

Rijndael1998 commented 1 year ago
/home/r/Documents/Git/Rchan/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:498
                throw new DiscordAPIError(data, 'code' in data ? data.code : data.error, status, method, url, requestData);
          ^
DiscordAPIError[50007]: Cannot send messages to this user
    at SequentialHandler.runRequest (/home/r/Documents/Git/Rchan/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:498:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SequentialHandler.queueRequest (/home/r/Documents/Git/Rchan/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:198:11)
    at async REST.request (/home/r/Documents/Git/Rchan/node_modules/@discordjs/rest/src/lib/REST.ts:343:20)
    at async DMChannel.send (/home/r/Documents/Git/Rchan/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:176:15) {
  requestBody: {
    files: [],
    json: {
      content: "Okay, dude. I'm sorry if I'm bothering you. I'll stop talking now. If you change your mind and want to chat, just let me know. Peace out.",
      tts: false,
      nonce: undefined,
      embeds: undefined,
      components: undefined,
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: [Object],
      attachments: undefined,
      sticker_ids: undefined,
      thread_name: undefined
    }
  },
  rawError: { message: 'Cannot send messages to this user', code: 50007 },
  code: 50007,
  status: 403,
  method: 'POST',
  url: 'https://discord.com/api/v10/channels/1083901252326404116/messages'
}
Rijndael1998 commented 1 year ago

I tested a 20 message conversation and got nothing

Rijndael1998 commented 1 year ago

Another test again today with 50 messages and nothing.

Rijndael1998 commented 1 year ago

I'll consider this fixed with #32 gets fixed. It'll implement exponential back off between the API and the Discord client.

Rijndael1998 commented 1 year ago

I have not seen this happen since. Will reopen if happens again. Closing.