ZumitoTeam / zumito-framework

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

EmojiFallback.getEmoji Compatibility with Modals, Buttons, and SelectMenu #47

Open WilliamAcosta1 opened 1 month ago

WilliamAcosta1 commented 1 month ago

Problem Description: Currently, the EmojiFallback.getEmoji(client, '', '') function is not compatible with Discord components such as Modals, Buttons, and SelectMenu. The issue arises because the function returns a format that is not accepted by these components, causing the application to crash. The components require only the emoji ID, but the function returns the full emoji format (<:Deny:1022960981372055582>), which includes the emoji name and ID.

Proposed Solution: To resolve this issue, we propose modifying the EmojiFallback.getEmoji function to include an additional parameter that specifies the type of component (e.g., Modal, Button, Embed, etc.). Based on this parameter, the function should return only the ID for components like Buttons and Modals, and the full format (name and ID) for other components if necessary.

Pros:

Cons:

Recommended Actions:

Modify Function: Update the EmojiFallback.getEmoji function to include an additional parameter for component type. Implement Conditional Logic: Implement logic to return the appropriate emoji format based on the specified component type. Testing: Conduct thorough testing to ensure the function works correctly with all specified components and does not cause any regressions. Documentation: Update the function documentation to reflect the new parameter and usage guidelines.

This issue will serve as the basis for enhancing the compatibility of the EmojiFallback.getEmoji function with various Discord components, improving the stability and flexibility of our application.