diff options
| author | Rapptz <[email protected]> | 2016-09-26 23:02:44 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-09-26 23:02:44 -0400 |
| commit | 5d8d3ab43a96705fc60885bae2671e4b217daf1d (patch) | |
| tree | 31555571f37f300211cd589290f7f38e3838fe41 | |
| parent | Add the ability to add, delete, and edit custom emoji. (diff) | |
| download | discord.py-5d8d3ab43a96705fc60885bae2671e4b217daf1d.tar.xz discord.py-5d8d3ab43a96705fc60885bae2671e4b217daf1d.zip | |
Add Permissions.manage_emojis
| -rw-r--r-- | discord/permissions.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/discord/permissions.py b/discord/permissions.py index b497eb83..3cf903e9 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -127,7 +127,7 @@ class Permissions: def all(cls): """A factory method that creates a :class:`Permissions` with all permissions set to True.""" - return cls(0b00011111111101111111110000111111) + return cls(0b00111111111101111111110000111111) @classmethod def all_channel(cls): @@ -148,7 +148,7 @@ class Permissions: def general(cls): """A factory method that creates a :class:`Permissions` with all "General" permissions from the official Discord UI set to True.""" - return cls(0b00011100000000000000000000111111) + return cls(0b00111100000000000000000000111111) @classmethod def text(cls): @@ -417,7 +417,21 @@ class Permissions: def manage_roles(self, value): self._set(28, value) - # 3 unused + @property + def manage_emojis(self): + """Returns True if a user can create or edit emojis. + + This also corresponds to the "manage permissions" channel-specific override. + """ + return self._bit(29) + + @manage_emojis.setter + def manage_emojis(self, value): + self._set(29, value) + + # 2 unused + + # after these 32 bits, there's 21 more unused ones technically def augment_from_permissions(cls): cls.VALID_NAMES = { name for name in dir(Permissions) if isinstance(getattr(Permissions, name), property) } |