pagination with button handler
Hello i want to refactor my current embed pagination. How do I update the embed in a separate button handler? A user starts a slashcommand where I create n embeds where n: n >= 1. the customId of the two buttons are in this format
RESERVATION-NEXT-' /*spotId*/
, RESERVATION-BACK-' /*spotId*/
,
In my button handler (interactionCreate.ts) i dont know how I access the embeds from my slashcommand which I have created to edit the current embed
2 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!so what I want is to have the logic collector.on in my handleSpotNext/BackButton
because when the bot restarts etc. the interaction fails
true thx so maybe i implement paginatioon oin my api so i always fetch the current page what do you think?
the data for the embed i get through my backend(API) and my idea is now i just create one embed in the beginning then when the user press the next button i fetch the second page from my backend and edit the current embed with the new data
What do you mean data does not change it is possible that the data is changing
Ah okay understood no it’s not like that every page has different data