discordx-ts / discordx

🤖 Create a discord bot with TypeScript and Decorators!
https://discordx.js.org
Apache License 2.0
615 stars 50 forks source link

[Bug]: plugin-ytdl-player Bot crashes when pressing button `Queue` #1057

Closed vllirette closed 3 months ago

vllirette commented 3 months ago

What happened?

When pressing the button Queue the bot crashes but it should be showing the queue.

Reproduction

Press the Queue button on the UI image

Note: using the command /music queue doesn't make the bot crash.

Package

plugin-ytdl-player

Relevant log output

/home/vllirette/projects/northcraft/northcraftbot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:187
    if (!this.deferred && !this.replied) return Promise.reject(new DiscordjsError(ErrorCodes.InteractionNotReplied));
                                                               ^
Error [InteractionNotReplied]: The reply to this interaction has not been sent or deferred.
    at ButtonInteraction.followUp (/home/vllirette/projects/northcraft/northcraftbot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:187:64)
    at Queue.view (file:///home/vllirette/projects/northcraft/northcraftbot/node_modules/@discordx/plugin-ytdl-player/src/queue.ts:283:38)
    at music.queueControl (file:///home/vllirette/projects/northcraft/northcraftbot/node_modules/@discordx/plugin-ytdl-player/src/index.ts:644:17)
    at next (file:///home/vllirette/projects/northcraft/northcraftbot/node_modules/discordx/dist/index.mjs:1081:41)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'InteractionNotReplied'
}

Code of Conduct

samarmeena commented 3 months ago

@vllirette should be fixed now. Thank you for reporting!

vllirette commented 3 months ago

@samarmeena Wow thanks for the fast response! It works 😃

samarmeena commented 3 months ago

@vllirette , thank you for your support. I'll be rewriting plugin-ytdl-player soon to improve the code. If you have any recommendations, please let me know.