discordx-ts / discordx

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

[Bug]: Button Component Handler Not Found: discordx@pagination #982

Closed blitzfall closed 6 months ago

blitzfall commented 6 months ago

What happened?

A warning is printed when switching pages using the pagination command, /all-commands, in the default option one create-discordx template.

This warning does not occur on other buttons and the command still works as expected.

Reproduction

  1. Use npx create-discordx to create a new discordx bot by selecting the first option.
  2. Setup environment for bot token by installing dotenv, importing it at the top, and creating a .env file with the token specified in it under the tag BOT_TOKEN
  3. Run using npm run watch
  4. Do /all-commands command
  5. Warning occurs when the page is changed regardless of how long one waits after the command is sent (I also tested modifying it to a list pagination, which also does not fix the issue).

Package

@discordx/pagination

Version

Stable

Relevant log output

Bot started
RTS Nations >> button component handler not found, interactionId: 1188965682486968330 | customId: discordx@pagination@nextButton

Code of Conduct

TeamWolfyta commented 6 months ago

It still works because the warning message is just a byproduct of the pagination module been the one to handle the returned ButtonComponent interaction using a message collector that has ZERO relation to Discordx's main client.

Because the pagination module doesn't use Discordx in anyway for handling the ButtonComponent interaction's, Discordx is just acting as if it can't find a handler that matches the ButonComponent's ID and warning you because to you it might be a pretty important thing that it finds a handler.

blitzfall commented 6 months ago

@TeamWolfyta Thanks for the information. For now, I will add an additional check locally to silence warnings where the customId starts with discordx@pagination.

@samarmeena Feel free to close if you decide this is the intended behavior for the pagination module's interaction with base discordx.

samarmeena commented 6 months ago

it is indeed what @TeamWolfyta described.