SGA-A / c2c

Source code for the custom app exclusive to cc, where most interactions begin and end.
MIT License
1 stars 0 forks source link

Add confirmation menus wherever needed #72

Closed SGA-A closed 5 months ago

SGA-A commented 7 months ago

Is your feature request related to a problem? Please describe. This issue addresses the need for confirmation menus. Instead of waiting for a message, use a button to get the recipient to press. The user can either respond by clicking confirm, deny, or give no input (essentially timing out the view). We have already developed a solution that makes this work.

This issue is just present to remind us that there are still certain confirmation menus that need to be added. Examples of areas that need the revamp include prestige and the like. There are also some places where a confirmation view hasn't been added, but should be.

Describe the solution you'd like Note that adding this solution means we need cannot allow the user to have multiple confirmation menus open at once. This means we have to detect when another confirmation is already active and prompt the user to finish that one first.

Apply the confirmation view to all parts of the bot that currently use an alternative, and add new confirmation menus to some other commands if necessary.

Describe alternatives you've considered It has been noted that the amount of edits the bot makes during these confirmations are excessive. In a single confirmation, the bot makes 3 API calls to edit the confirmation message. This isn't really a problem for the scale of the bot as it is right now, but as the load increases due to increased traffic, this would cause ratelimits applied on the bot for these associated headers.

Since the bot actually has to respond to buttons being pressed, it's not really possible to reduce the number of edits. I will try to tinker around with it though and see what can be done.

Additional context Confirmation views (or panels) are needed to double check that the user is actually sure they wish to do something. In the past, when buttons weren't around, developers had to wait for message events (i.e. waiting for a message to be sent by the user and checking every single one). The new buttons are a great way to implement this commonly needed feature.

SGA-A commented 7 months ago

We have already started work on this here: https://github.com/SGA-A/c2c/commit/43eefb79621f4a4ce53369141f932107732b40f2

There are still some bugs as of the latest commit though that I will update in the next push.

SGA-A commented 6 months ago

This appears to be an issue in several other places throughout the bot. To prevent creating a duplicate issue, this one is reopening.

The problem is still prevalent in places such as bulk adding roles to users, purging messages (the context menu) and many other areas.

serephenna commented 5 months ago

The problem is still prevalent in places such as bulk adding roles to users, purging messages (the context menu) and many other areas.

Since several commits, all these areas mentioned without confirmation prompts now have them.