Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: (PaginatedMessage) 'Go To Page' button to get page input from a user via a text modal #610

Open
1 task done
GoldenAngel2 opened this issue Jun 23, 2023 · 1 comment

Comments

@GoldenAngel2
Copy link

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

Have an option to have a button Go To Page button show a text input modal for input on what page the bot should go to.

  • This would allow more than 25 pages.
  • Gives developers other options when it comes to displaying pages to users.
  • It gives a more clean way of allowing the user to go to a certain page without the developer limiting PaginatedMessage to only 25 pages.

Or removing the string select menu and bypassing addPage / addPages warning / check for the 25 page limit, which is what you can do currently but removes the ability to go to a certain page.

Desired solution

For PaginatedMessage add an option to use / not use the 'Go To Page' button as a default action to be handled by the package itself.

  • PaginatedMessage adds Go To Page / button to the pages
  • PaginatedMessage Once that button is pressed it will show a modal to get a page number input from the user.
  • PaginatedMessage Once that modal is submitted it will be processed and the page will change (if valid etc.)

Alternatives considered

N/A

Additional context

No response

@favna
Copy link
Member

favna commented Jun 25, 2023

I'm not really inclined to do this. The default options are intentionally opinionated and there are methods to very easily replace the default options. Furthermore, if you have many usages of PaginatedMessage in your bot it is very easy to simply extend it:

class MyPaginatedMessage extends PaginatedMessage {
 // ...
}

Furthermore, we would have to do input validation for text input because there is no way to restrict the user to entering only numbers between 1 and X in a text input. Users can also enter any string, or indices completely out of range. It's very bad UX when the actual desired content is restricted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants