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

Update permission class methods for v1.7 #6476

Merged
merged 5 commits into from Mar 1, 2021
Merged

Update permission class methods for v1.7 #6476

merged 5 commits into from Mar 1, 2021

Conversation

NicolasAlmerge
Copy link
Contributor

@NicolasAlmerge NicolasAlmerge commented Feb 24, 2021

Summary

The Discord UI has recently changed its permission categories, which are as follows:

  • General Permissions no longer have the administrator, create_instant_invite, change_nickname, manage_nicknames, kick_members and ban_members permissions. It now has the view_channel/read_messages permission.
  • New Membership Permissions which contain create_instant_invite, change_nickname, manage_nicknames, kick_members and ban_members permissions
  • Text Permissions no longer have the view_channel/read_messages permission (this has been moved to the General Permissions). It now contains the use_slash_commands permission, which has been released on Discord officially.
  • New Advanced Permissions which only contain the administrator permission.

The commit is therefore reflecting these changed. More specifically:

  • Permissions.all() now contains the use_slash_commands permission.
  • Permissions.general() has been updated according to the Discord UI general permissions.
  • Added Permissions.membership() which contains the create_instant_invite, change_nickname, manage_nicknames, kick_members and ban_members permissions.
  • Permissions.text() no longer contain the read_messages/view_channel permission. It now contains the use_slash_commands permission.
  • Added Permissions.advanced() which is an alias for Permission.administrator.

This commit also modifies the Permissions.all_channel() class method, by adding the stream, priority_speaker and use_slash_commands permissions which were missing.

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/permissions.py Outdated Show resolved Hide resolved
discord/permissions.py Outdated Show resolved Hide resolved
discord/permissions.py Outdated Show resolved Hide resolved
discord/permissions.py Outdated Show resolved Hide resolved
NicolasAlmerge and others added 3 commits February 25, 2021 12:38
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
@NicolasAlmerge NicolasAlmerge changed the title Updated permission class methods for v1.7 Update permission class methods for v1.7 Feb 25, 2021
discord/permissions.py Outdated Show resolved Hide resolved
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
@Rapptz Rapptz merged commit 9c52432 into Rapptz:master Mar 1, 2021
@Rapptz Rapptz added this to the v1.7 milestone Mar 1, 2021
@ShineyDev ShineyDev mentioned this pull request Mar 1, 2021
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants