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

Embed Instance MVVM #39

Open
khionu opened this issue Jun 8, 2020 · 0 comments
Open

Embed Instance MVVM #39

khionu opened this issue Jun 8, 2020 · 0 comments
Labels
Blocked enhancement New feature or request

Comments

@khionu
Copy link
Member

khionu commented Jun 8, 2020

Various parts of the bot will get a bit "noisy" to not have some feature to limit the amount of information displayed. I suggest we have a utility to manage embeds via limited-lifetime MVVM instances.

Suggested outline:

  • A Page<S> trait where S is the state
    • render function to generate the embed, taking the state and context, and returning an EmbedBuilder and set of reactions to be added to the message
    • callback function for when a reaction is clicked. Takes state and context, and returns a Transition, which will include Transition::NoOp
  • This will be managed in a Future that has an inner time out that is reset immediately before callback is invoked.
  • Possibly an associated constant with configurations for that Page.
@khionu khionu added enhancement New feature or request Blocked labels Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant