Browse Source

Add create_expressions permission

pull/9422/head
Andrin S 2 years ago
committed by GitHub
parent
commit
be71383af9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      discord/permissions.py

21
discord/permissions.py

@ -219,6 +219,7 @@ class Permissions(BaseFlags):
- :attr:`kick_members` - :attr:`kick_members`
- :attr:`ban_members` - :attr:`ban_members`
- :attr:`administrator` - :attr:`administrator`
- :attr:`create_expressions`
.. versionchanged:: 1.7 .. versionchanged:: 1.7
Added :attr:`stream`, :attr:`priority_speaker` and :attr:`use_application_commands` permissions. Added :attr:`stream`, :attr:`priority_speaker` and :attr:`use_application_commands` permissions.
@ -229,9 +230,9 @@ class Permissions(BaseFlags):
:attr:`request_to_speak` permissions. :attr:`request_to_speak` permissions.
.. versionchanged:: 2.3 .. versionchanged:: 2.3
Added :attr:`use_soundboard` Added :attr:`use_soundboard`, :attr:`create_expressions` permissions.
""" """
return cls(0b1000111110110110011111101111111111101010001) return cls(0b01000111110110110011111101111111111101010001)
@classmethod @classmethod
def general(cls) -> Self: def general(cls) -> Self:
@ -243,8 +244,11 @@ class Permissions(BaseFlags):
permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`, permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`,
:attr:`ban_members`, :attr:`change_nickname` and :attr:`manage_nicknames` are :attr:`ban_members`, :attr:`change_nickname` and :attr:`manage_nicknames` are
no longer part of the general permissions. no longer part of the general permissions.
.. versionchanged:: 2.3
Added :attr:`create_expressions` permission.
""" """
return cls(0b01110000000010000000010010110000) return cls(0b10000000000001110000000010000000010010110000)
@classmethod @classmethod
def membership(cls) -> Self: def membership(cls) -> Self:
@ -557,7 +561,7 @@ class Permissions(BaseFlags):
@flag_value @flag_value
def manage_guild_expressions(self) -> int: 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 .. versionadded:: 2.3
""" """
@ -672,6 +676,14 @@ class Permissions(BaseFlags):
""" """
return 1 << 42 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 @flag_value
def use_external_sounds(self) -> int: def use_external_sounds(self) -> int:
""":class:`bool`: Returns ``True`` if a user can use sounds from other guilds. """:class:`bool`: Returns ``True`` if a user can use sounds from other guilds.
@ -806,6 +818,7 @@ class PermissionOverwrite:
use_soundboard: Optional[bool] use_soundboard: Optional[bool]
use_external_sounds: Optional[bool] use_external_sounds: Optional[bool]
send_voice_messages: Optional[bool] send_voice_messages: Optional[bool]
create_expressions: Optional[bool]
def __init__(self, **kwargs: Optional[bool]): def __init__(self, **kwargs: Optional[bool]):
self._values: Dict[str, Optional[bool]] = {} self._values: Dict[str, Optional[bool]] = {}

Loading…
Cancel
Save