bot icon indicating copy to clipboard operation
bot copied to clipboard

Safeguards against accidentally banning staff members

Open ionite34 opened this issue 2 years ago • 9 comments

To avoid any more situations like these: image

Propose to add:

:warning: This action will apply ban to a staff member, @user (User Name #8405). To confirm, rerun the command with --force

ionite34 avatar Oct 28 '22 15:10 ionite34

We could have the confirmation as a button instead of a flag.

vivekashok1221 avatar Oct 28 '22 16:10 vivekashok1221

What about instead of rerunning the command with --force, which may be abused, a confirmation dialog that you click to confirm?

CaedenPH avatar Oct 28 '22 16:10 CaedenPH

I like the idea of the button. if the user has one of constants.STAFF_PARTNERS_COMMUNITY_ROLES reply to the user with a warning message and a confirmation button.

ChrisLovering avatar Oct 28 '22 16:10 ChrisLovering

I would be willing to take this up

Robin5605 avatar Oct 28 '22 16:10 Robin5605

I would be willing to take this up

Sounds good, feel free to self assign

ChrisLovering avatar Oct 28 '22 16:10 ChrisLovering

yoinked

Robin5605 avatar Oct 28 '22 16:10 Robin5605

FYI, https://bot-core.pythondiscord.com/main/output/botcore.utils.interactions.html#botcore.utils.interactions.ViewWithUserAndRoleCheck might be a good view to subclass as it comes with some nice checks out of the box

ChrisLovering avatar Oct 28 '22 16:10 ChrisLovering

Maybe. In this case the command itself (!ban) will only run if the use is authorized. After that it's only a simple matter of checking if the interaction user is the same as the one who triggered the command. This is a design decision though. Do we want other moderators to be able to cancel a potential helper ban?

Robin5605 avatar Oct 28 '22 16:10 Robin5605

Yea, this just adds a nice helper function to remove the button from the message on timeout

ChrisLovering avatar Oct 28 '22 16:10 ChrisLovering