-
-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Is there an existing issue or pull request for this?
- I have searched the existing issues and pull requests
Feature description
I was using PaginatedFieldMessageEmbed and I added my own custom actions (functional equivalents of 'back', 'forward', and 'submit'). Went to run it and I was confused why they weren't showing up. I did some digging and it seems like actions (exlcuding page specific actions) are only added if the number of pages is greater than 1, which in my case they weren't. While this was fine for the 'back' and 'forward' actions, I needed the 'submit' action to show at all times.
Desired solution
It would be nice if there was a method like setPersistentActions that added actions regardless of page count. Alternatively, add a property on PaginatedMessageAction like persistent?: boolean to indicate that the action should persist on all pages.
Alternatives considered
For now, I can work around this limitation by doing the following:
const paginatedEmbed = new PaginatedFieldMessageEmbed()
.setActions([ /* 'back' and 'forward' actions */ ])
.make();
const submit: PaginatedMessageActionButton = { /* stuff */ };
for (let i = 0; i < paginatedEmbed.pages.length; i++) {
paginatedEmbed.addPageAction(submit, i);
}
paginatedEmbed.run(interaction);Additional context
No response