Updating paginated message pages while the handler is running
I'm trying to make a paginated message that can be updated after its creation.
My command currently:
1. Responds with the paginated message with data from the database
2. Fetches new data from an API in the background
3. Updates the pages of the paginated message with this new data
I'm currently using the following code to handle the "background task" logic:
This works but after the update happens the components of the paginated message don't respond anymore and result in
This interaction failed
.
Is there a different way to go about this? Because I essentially just need to reload/refresh the current page.1 Reply
it seems like removing the listeners of the old paginated message and creating a new instance works
seems the best sollution for this is to use the provided
.clone()
method for this