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

Implement (bot_)has_guild_permissions #2460

Closed
wants to merge 4 commits into from
Closed

Implement (bot_)has_guild_permissions #2460

wants to merge 4 commits into from

Conversation

XuaTheGrate
Copy link
Contributor

Summary

Adds two new decorators for checking guild wide permissions, as opposed to the current has_permissions decorator which runs on the invocation channel permissions.
This allows for better checking of certain permissions, such as mute_members for voice, and manage_roles which is different for channel overrides.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@yo-ru
Copy link

yo-ru commented Dec 2, 2019

I'm glad you did this.
Will make things more simplistic.
+1

Copy link
Owner

@Rapptz Rapptz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation seems to work with a DM context but I feel like the name itself implies guild_only so I don't think working in DM is a desirable feature for these particular checks.

discord/ext/commands/core.py Outdated Show resolved Hide resolved
discord/ext/commands/core.py Outdated Show resolved Hide resolved
discord/ext/commands/core.py Outdated Show resolved Hide resolved
@Rapptz Rapptz added the merged Tag to mark pull requests as rebased or merged label Dec 17, 2019
@Rapptz Rapptz closed this Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged Tag to mark pull requests as rebased or merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants