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

[Permissions] Deny command with Class match #3014

aikaterna opened this issue Sep 25, 2019 · 0 comments · Fixed by #3015

[Permissions] Deny command with Class match #3014

aikaterna opened this issue Sep 25, 2019 · 0 comments · Fixed by #3015
Status: In Progress Type: Bug


Copy link

@aikaterna aikaterna commented Sep 25, 2019

Command bugs

Command name

permissions removeserverrule

What cog is this command from?


What were you expecting to happen?

For permissions to be able to determine that I was asking for a command instead of the cog.

What actually happened?

For this example, I have a cog called test. The class is Test and it has a command named test. The role that I am allowing/denying to use the command is called Rolename.

I used:

[p]permissions setdefaultglobalrule deny test
[p]permissions addserverrule allow test Rolename
[p]permissions removeserverrule test Rolename

I received:

[2019-09-25 15:38:59] [ERROR] red: Exception in command 'permissions removeserverrule'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/discord/ext/commands/", line 79, in wrapped
    ret = await coro(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/redbot/cogs/permissions/", line 383, in permissions_removeguildrule
  File "/usr/local/lib/python3.7/site-packages/redbot/cogs/permissions/", line 511, in _remove_rule
    cog_or_cmd.obj.clear_rule_for(model_id, guild_id=guild_id)
  File "/usr/local/lib/python3.7/site-packages/redbot/core/commands/", line 403, in clear_rule_for
    should_continue = parent.reevaluate_rules_for(model_id, guild_id=guild_id)[1]
  File "/usr/local/lib/python3.7/site-packages/redbot/core/commands/", line 521, in reevaluate_rules_for
    for cmd in self.all_commands.values()
AttributeError: 'Test' object has no attribute 'all_commands'

How can we reproduce this issue?

Follow the instructions outlined above in the previous section.

@mikeshardmind mikeshardmind added Status: In Progress Type: Bug labels Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Status: In Progress Type: Bug
None yet

Successfully merging a pull request may close this issue.

2 participants