discord-bot-best-practices icon indicating copy to clipboard operation
discord-bot-best-practices copied to clipboard

Don't execute no-idempotent commands if can't reply to them

Open EduenSarceno opened this issue 5 years ago • 1 comments

Don't execute no-idempotent commands if can't reply to them. Mostly commands send a message to the user either on success or error. The user expects at least one reply when running a command. But, in certain configurations, the bot doesn't have the permission to write on a channel (SEND_MESSAGES). So, the user tends to run the command twice or more thinking that command failed silently i.e: invalid number of args, invalid command (see rule 6), bot offline, etc.

e.g suppose the command donate that gifts virtual currency to guild server. The user runs donate 1000 on a channel where bot can't reply due to guild configuration, the bot executes the command and reduces the amount to the user, but can't send a success message. Because reply not send, the user runs again donate 1000 thinking that command failed silently. The result, the user donated twice the amount, and now he is virtually broken. =(


My English is not good, so I send this as suggestion instead of PR. feel free to edit this and fix my spelling and grammar mistakes

EduenSarceno avatar Apr 29 '19 03:04 EduenSarceno

I like the idea, but I feel as if it shouldn't be required to tell coders to do this. You should expect that if the bot failed in ANY way, either undo the action or only do the action after it has permission.

Unfortunately, this repo is dead, so I doubt any changes will be made. (Watch as this is the one time he comes back)

FireController1847 avatar Apr 29 '19 04:04 FireController1847