From be71383af9612f17926f20a503157c8a4cc1b10e Mon Sep 17 00:00:00 2001 From: Andrin S <65789180+Puncher1@users.noreply.github.com> Date: Sat, 20 May 2023 02:31:39 +0200 Subject: [PATCH] Add create_expressions permission --- discord/permissions.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/discord/permissions.py b/discord/permissions.py index 47c50c35f..c0b5ee3f4 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -219,6 +219,7 @@ class Permissions(BaseFlags): - :attr:`kick_members` - :attr:`ban_members` - :attr:`administrator` + - :attr:`create_expressions` .. versionchanged:: 1.7 Added :attr:`stream`, :attr:`priority_speaker` and :attr:`use_application_commands` permissions. @@ -229,9 +230,9 @@ class Permissions(BaseFlags): :attr:`request_to_speak` permissions. .. versionchanged:: 2.3 - Added :attr:`use_soundboard` + Added :attr:`use_soundboard`, :attr:`create_expressions` permissions. """ - return cls(0b1000111110110110011111101111111111101010001) + return cls(0b01000111110110110011111101111111111101010001) @classmethod def general(cls) -> Self: @@ -243,8 +244,11 @@ class Permissions(BaseFlags): permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`, :attr:`ban_members`, :attr:`change_nickname` and :attr:`manage_nicknames` are no longer part of the general permissions. + + .. versionchanged:: 2.3 + Added :attr:`create_expressions` permission. """ - return cls(0b01110000000010000000010010110000) + return cls(0b10000000000001110000000010000000010010110000) @classmethod def membership(cls) -> Self: @@ -557,7 +561,7 @@ class Permissions(BaseFlags): @flag_value def manage_guild_expressions(self) -> int: - """:class:`bool`: Returns ``True`` if a user can create, edit, or delete emojis, stickers, and soundboard sounds. + """:class:`bool`: Returns ``True`` if a user can edit or delete emojis, stickers, and soundboard sounds. .. versionadded:: 2.3 """ @@ -672,6 +676,14 @@ class Permissions(BaseFlags): """ return 1 << 42 + @flag_value + def create_expressions(self) -> int: + """:class:`bool`: Returns ``True`` if a user can create emojis, stickers, and soundboard sounds. + + .. versionadded:: 2.3 + """ + return 1 << 43 + @flag_value def use_external_sounds(self) -> int: """:class:`bool`: Returns ``True`` if a user can use sounds from other guilds. @@ -806,6 +818,7 @@ class PermissionOverwrite: use_soundboard: Optional[bool] use_external_sounds: Optional[bool] send_voice_messages: Optional[bool] + create_expressions: Optional[bool] def __init__(self, **kwargs: Optional[bool]): self._values: Dict[str, Optional[bool]] = {}