discord-mods-bot icon indicating copy to clipboard operation
discord-mods-bot copied to clipboard

Embed Instance MVVM

Open khionu opened this issue 5 years ago • 0 comments

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 avatar Jun 08 '20 18:06 khionu