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

Conversation

@XuaTheGrate
Copy link
Contributor

XuaTheGrate commented Dec 1, 2019

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, ...)
discord/ext/commands/core.py Outdated Show resolved Hide resolved
@Nightsh0t

This comment has been minimized.

Copy link

Nightsh0t commented Dec 2, 2019

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

Copy link
Owner

Rapptz left a comment

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 rebased label Dec 17, 2019
@Rapptz
Rapptz approved these changes 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.