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

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

Open
WildCard65 opened this issue Aug 11, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@WildCard65
Copy link

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 WildCard65 added the bug Something isn't working label Aug 11, 2024
@WildCard65
Copy link
Author

WildCard65 commented Aug 11, 2024

Source of the issue is: utils.checks.has_permissions

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant