Browse Source

Add Permissions.use_external_apps

pull/9863/head
DA344 10 months ago
committed by GitHub
parent
commit
895d6c37df
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 19
      discord/permissions.py

19
discord/permissions.py

@ -241,10 +241,10 @@ class Permissions(BaseFlags):
Added :attr:`use_soundboard`, :attr:`create_expressions` permissions.
.. versionchanged:: 2.4
Added :attr:`send_polls`, :attr:`send_voice_messages`, attr:`use_external_sounds`, and
:attr:`use_embedded_activities` permissions.
Added :attr:`send_polls`, :attr:`send_voice_messages`, attr:`use_external_sounds`,
:attr:`use_embedded_activities`, and :attr:`use_external_apps` permissions.
"""
return cls(0b0000_0000_0000_0010_0110_0100_1111_1101_1011_0011_1111_0111_1111_1111_0101_0001)
return cls(0b0000_0000_0000_0110_0110_0100_1111_1101_1011_0011_1111_0111_1111_1111_0101_0001)
@classmethod
def general(cls) -> Self:
@ -291,9 +291,9 @@ class Permissions(BaseFlags):
Added :attr:`send_voice_messages` permission.
.. versionchanged:: 2.4
Added :attr:`send_polls` permission.
Added :attr:`send_polls` and :attr:`use_external_apps` permissions.
"""
return cls(0b0000_0000_0000_0010_0100_0000_0111_1100_1000_0000_0000_0111_1111_1000_0100_0000)
return cls(0b0000_0000_0000_0110_0100_0000_0111_1100_1000_0000_0000_0111_1111_1000_0100_0000)
@classmethod
def voice(cls) -> Self:
@ -760,6 +760,14 @@ class Permissions(BaseFlags):
"""
return 1 << 49
@flag_value
def use_external_apps(self) -> int:
""":class:`bool`: Returns ``True`` if a user can use external apps.
.. versionadded:: 2.4
"""
return 1 << 50
def _augment_from_permissions(cls):
cls.VALID_NAMES = set(Permissions.VALID_FLAGS)
@ -882,6 +890,7 @@ class PermissionOverwrite:
create_events: Optional[bool]
send_polls: Optional[bool]
create_polls: Optional[bool]
use_external_apps: Optional[bool]
def __init__(self, **kwargs: Optional[bool]):
self._values: Dict[str, Optional[bool]] = {}

Loading…
Cancel
Save