ZumitoTeam / zumito-framework

Framework for creating a bot for discord
https://framework.zumito.dev
8 stars 1 forks source link

[➕] Implement Modals #25

Open WilliamAcosta1 opened 1 year ago

WilliamAcosta1 commented 1 year ago

Problem Description Currently, Zumito Framework does not have native support for modals. Modals are a useful tool for requesting information from users in a clear and organized way, and it would be great to have their implementation in Zumito Framework.

Proposed Solution I request the implementation of modals in Zumito Framework. I believe that this functionality could be added as an optional plugin that does not affect the basic functionality of the framework. Although there are some community-created modules to implement modals in Zumito Framework, having this functionality available officially would be much more convenient and would help make the framework even more complete.

Pros

  1. Better organization and clarity when requesting information from users
  2. Greater convenience for users when filling out forms
  3. Possible time savings in implementing this functionality in future projects

Cons

  1. Possible increase in the size of the framework
  2. Possible increase in the complexity of the framework

I appreciate your attention to this request and I'm looking forward to any comments or suggestions to improve this proposal.

fernandomema commented 1 year ago

A very interesting topic. Here is a list of things to do this task:

  1. Create a modal manager that can store different modal layouts.
  2. Define each modal layout in separate JavaScript files within the modals folder of each module. Each modal layout should contain: a. Definition of the modal fields. b. Functions to be executed when saving or canceling.
  3. Include a method in the modal manager to register the modal layouts.
  4. Register the modals on the Module class.
  5. Include a method in the modal manager to launch the registered modals from commands or events.