eritislami / evobot

🤖 EvoBot is a Discord Music Bot built with TypeScript + Discord.js, includes Docker builds & localization in 20+ languages
MIT License
1.84k stars 2.02k forks source link

Bug: Song playing reaction add issue! #71

Closed paraswtf closed 4 years ago

paraswtf commented 4 years ago

Describe the bug Sometimes the bot fails to add reaction to the playing message. It adds some reactions but then throws the error below and does not add reactions for some reason. The error is related to delete message. But it causes add reactions to fail.

How To Reproduce Steps to reproduce the behavior: Its random but occurs sometimes. 1.Search something 2.Stop the last song then start a new one immediately.

Environment (add if possible)

Additional information & screenshots In my code, no changes are made to the original code except the name of files is changed.

Here's the error, the que stops on end and everything works fine, only the reactions are not added.

DiscordAPIError: Unknown Message
    at RequestHandler.execute (D:\Other\Bot Coding\Bots\Currently Working\evobot\evobot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  method: 'delete',
  path: '/channels/718919267923263491/messages/721451579454259300/reactions',
  code: 10008,
  httpStatus: 404
}

[Image of no reactions added] image

[Queue ends upon song end and skip command works] image

paraswtf commented 4 years ago

This issue is also occured here(message delete error)- https://github.com/eritislami/evobot/issues/70#issuecomment-643668433

eritislami commented 4 years ago

I tried the steps you mentioned and i can't reproduce, also i don't get this unknown message error, try testing again with the latest commit

paraswtf commented 4 years ago

Is this some issue with discordjs??? It keeps happening, i checked everything... Even in your latest commit... It happens randomly, and it keeps happening once it happens, whenever you skip... only way to avoid it is to restart bot....

DiscordAPIError: Unknown Message
    at RequestHandler.execute (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  method: 'put',
  path: '/channels/720692802106949664/messages/721944934206406788/reactions/%E2%8F%AD/@me',
  code: 10008,
  httpStatus: 404
}
DiscordAPIError: Unknown Message
    at RequestHandler.execute (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  method: 'put',
  path: '/channels/720692802106949664/messages/721945038996766790/reactions/%E2%8F%AF/@me',
  code: 10008,
  httpStatus: 404
}
paraswtf commented 4 years ago

The message is also correct...

paraswtf commented 4 years ago

@eritislami The issue is still occuring on the latest version... It occurs when you click on two reactions before the message is deleted while pruning...

eritislami commented 4 years ago

@eritislami The issue is still occuring on the latest version... It occurs when you click on two reactions before the message is deleted while pruning...

Try again with f49327e4194416d0e5b028f32d6da3b8c4c9adb3

GokseLW commented 4 years ago

@ParasDeshpande ur music bot work (evobot) ?

paraswtf commented 4 years ago

What exactly do you mean by work? @GokseLW Yes, it runs properly and plays music, but sometimes crashes due to some videos that cannot be played...

eritislami commented 4 years ago

sometimes crashes due to some videos that cannot be played...

There was a pull request merged to fix this in ytdl-core-discord, you can check it here: https://github.com/amishshah/ytdl-core-discord/pull/200

To get the latest version of the package delete node_modules & package-lock.json and run npm install