trixiebot icon indicating copy to clipboard operation
trixiebot copied to clipboard

[ Bug ] Bot runs into an issue when trying to attach files without permissions

Open zneix opened this issue 5 years ago • 1 comments

Before submitting I have:

  • [x] Made sure this is actual unintended behaviour.
  • [ ] Double checked !help <command name> (if this is command related) for potential misunderstandings.

Describe the bug Someone in a server said lone pone, which triggered trixiebot to post an image, however bot didn't have Attach Files permission in that channel and ran into an issue.

To Reproduce

  1. Make a channel, where bot doesn't haveAttach Files permission.
  2. Send lone pone.

Expected behavior Handle this edge case properly and check for permissions (and don't try to send a message) instead of catching an error...

Additional context https://i.nuuls.com/T12TG.jpeg

zneix avatar Aug 02 '20 17:08 zneix

The lone pone keyword has been removed. But to fix this problem in other commands the BaseCommand class could additionally implement .requires_perms and #setRequiredPermissions(Bitfield) which would be checked by the CommandDispatcher when the command is executed and throw an error saying "This command requires ... permissions to function properly" with an option to fail silently.

LonelessCodes avatar Nov 09 '20 12:11 LonelessCodes