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

Add command confirmation system for sensitive actions #344

Open
wants to merge 2 commits into
base: 1.21
Choose a base branch
from

Conversation

MrLiam2614
Copy link

Introduced a confirmation mechanism requiring users to explicitly confirm certain commands, preventing unintended actions. This includes a new /flan confirm command, callback handling, and supporting translations for confirmation and cancellation messages. Confirmation for now added only to adminDelete

Improves the current system where you have to send the command twice (not replaced in the code, so the Dev can evaluate what to do)

Introduced a confirmation mechanism requiring users to explicitly confirm certain commands, preventing unintended actions.
This includes a new `/flan confirm` command, callback handling, and supporting translations for confirmation and cancellation messages.
Confirmation for now added only to adminDelete
Moved confirmation messages to a simpler translation key structure for improved clarity and consistency. Adjusted related code to utilize the new keys and removed redundant entries.
@Flemmli97
Copy link
Owner

What would be the advantage to the current system?
Currently typing the current command twice allows you to just press arrow key making it a bit easier but not trivial to run sensitive commands which was my intention.
Also i dont think you can check what command is currently pending so if you dont deny it it seems to linger there forever. Meanwhile currently you need to type the same command within a timeframe.

@MrLiam2614
Copy link
Author

MrLiam2614 commented Jan 18, 2025

The /flan confirm system was introduced to make sensitive commands more convenient and secure. We’ve noticed that, with the current system, it’s easier to accidentally trigger a command by pressing “up arrow” followed by “Enter.” This issue has occurred several times on our server, leading to unintended actions. The new approach significantly reduces the risk of such mistakes.

Regarding the "pending" issue, you're absolutely right: currently, the command stays active indefinitely. I forgot to add a task to make the confirm expire after a set period. If you think this adjustment could work better, I can implement it in the next update.

Alternatively, if you believe the current system is sufficient, I would still recommend adding a confirmation specifically for the adminDelete command. It’s a critical action, and we’ve already had cases where a staff member used it by mistake, causing unnecessary issues.

Let me know what you think and if we can discuss further improvements! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants