Eccleria / ewibot

Discord bot for La Quête d'Ewilan server.
3 stars 0 forks source link

onMessageDelete - content must be non empty #273

Open Eccleria opened 9 months ago

Eccleria commented 9 months ago
/home/ewibot/ewibot/node_modules/discord.js/src/util/Util.js:504
    if (!allowEmpty && data.length === 0) throw new error(errorMessage);
                                                ^

RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string.
    at Function.verifyString (/home/ewibot/ewibot/node_modules/discord.js/src/util/Util.js:504:49)
    at MessagePayload.makeContent (/home/ewibot/ewibot/node_modules/discord.js/src/structures/MessagePayload.js:114:22)
    at MessagePayload.resolveData (/home/ewibot/ewibot/node_modules/discord.js/src/structures/MessagePayload.js:129:26)
    at ThreadChannel.send (/home/ewibot/ewibot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:173:61)
    at Client.onMessageDelete (file:///home/ewibot/ewibot/src/admin/listeners.js:568:36)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  [Symbol(code)]: 'MESSAGE_CONTENT_TYPE'
}
Eccleria commented 3 months ago
node:events:495
      throw er; // Unhandled 'error' event
      ^

DiscordAPIError[50006]: Cannot send an empty message
    at handleErrors (/home/ewibot/ewibot/node_modules/@discordjs/rest/dist/index.js:640:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SequentialHandler.runRequest (/home/ewibot/ewibot/node_modules/@discordjs/rest/dist/index.js:1021:23)
    at async SequentialHandler.queueRequest (/home/ewibot/ewibot/node_modules/@discordjs/rest/dist/index.js:862:14)
    at async REST.request (/home/ewibot/ewibot/node_modules/@discordjs/rest/dist/index.js:1387:22)
    at async ThreadChannel.send (/home/ewibot/ewibot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:162:15)
    at async Client.onMessageDelete (file:///home/ewibot/ewibot/src/admin/listeners.js:504:19)
Emitted 'error' event on Client instance at:
    at emitUnhandledRejectionOrErr (node:events:398:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
  requestBody: {
    files: [],
    json: {
      content: '',
      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: 'Cannot send an empty message', code: 50006 },
  code: 50006,
  status: 400,
  method: 'POST',
  url: 'https://discord.com/api/v10/channels/1012365101594058762/messages'
}

Node.js v18.19.0