modmail icon indicating copy to clipboard operation
modmail copied to clipboard

Bug: Bot checks permissions of channel commands are executed in.

Open WildCard65 opened this issue 6 months ago • 1 comments

Describe the bug When executing certain commands, mainly configuration commands like accessrole, the bot will check to see if it has Manage Channel and Manage Permissions enabled in the channel the command is executed in even if the channel is not part of ModMail's own category.

To Reproduce Steps to reproduce the behavior:

  1. Setup ModMail on a fresh Discord server.
  2. Configure ModMail's role to have "Manage Channel" and "Manage Roles" disabled.
  3. Configure the default "#general" channel AND ModMail's category to explicitly enable "Manage Channel" and "Manage Permissions".
  4. Create a new text channel where ModMail and explicitly disable "Manage Channel" and "Manage Permissions".
  5. Create a dummy role that will serve as an access role.
  6. Run "=accessrole " in the channel created in Step 4. The bot should complain of lack of permissions.
  7. Run "=accessrole " in the default "#general" channel, the bot should successfully update the ModMail category for the role.

Expected behavior The bot should only care if it has the required permissions on the category all tickets will be created under.

Screenshots I have a lot of screenshots and will try to make sure there is a clear order to them. If all else fails, they were all made on the same day so you can follow the message timestamps for the most part. Screenshot of where command channel is Screenshot of where ModMail category is Screenshot showing command fails Screenshot showing override added for command channel Screenshot of Carlbot logging override Screenshot showing command succeeds Screenshot showing reversion of override in logs Screenshot showing command fails again Screenshot showing command succeeds again Screenshot showing what was changed that resulted in success

Additional Context ModMail does not have the Administrator permission, this permissions overrides everything to be enabled regardless of permissions.

WildCard65 avatar Aug 11 '24 02:08 WildCard65