Simpleboy353 / REAPER-2.0

A multi-purpose discord bot made using Discord.js V14. Includes Logging, Welcomer, Slash Commands, Menu based Help Command and so much more!
GNU General Public License v3.0
329 stars 225 forks source link

[FATAL] Possibly Unhandled Rejection #156

Closed CrazyGladiator closed 2 years ago

CrazyGladiator commented 2 years ago

Bot start fine and in the middle of a song i get this error.

[FATAL] Possibly Unhandled Rejection at: Promise  Promise {
  <rejected> DiscordAPIError: Unknown Message
      at RequestHandler.execute (D:\Documents\REAPER-2.0-master\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async RequestHandler.push (D:\Documents\REAPER-2.0-master\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
      at async MessageManager.delete (D:\Documents\REAPER-2.0-master\node_modules\discord.js\src\managers\MessageManager.js:205:5)
      at async Message.delete (D:\Documents\REAPER-2.0-master\node_modules\discord.js\src\structures\Message.js:709:5) {
    method: 'delete',
    path: '/channels/913591399323148288/messages/933772912731770981',
    code: 10008,
    httpStatus: 404,
    requestData: { json: undefined, files: [] }
  }
}  reason:  Unknown Message
Uncaught Exception: TypeError: Cannot read properties of undefined (reading 'send')
D:\Documents\REAPER-2.0-master\index.js:80
  client.channels.cache.get(ERROR_LOGS_CHANNEL).send({ embeds: [exceptionembed] })
                                               ^

TypeError: Cannot read properties of undefined (reading 'send')
    at process.<anonymous> (D:\Documents\REAPER-2.0-master\index.js:80:48)
    at process.emit (node:events:390:28)
    at process._fatalException (node:internal/process/execution:170:25)
Simpleboy353 commented 2 years ago

Maybe the bot is trying to delete a message that is already deleted

CrazyGladiator commented 2 years ago

is there a way i can stop the bot from removing the message ?

Simpleboy353 commented 2 years ago

Thats a function of the bot to delete the message. So don't worry about this error, it won't affect the performance of the bot.