Skip to content

Commit

Permalink
Add Permissions.use_external_apps
Browse files Browse the repository at this point in the history
  • Loading branch information
DA-344 authored Jun 11, 2024
1 parent fdb17ea commit 895d6c3
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions discord/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ def all_channel(cls) -> Self:
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:
Expand Down Expand Up @@ -291,9 +291,9 @@ def text(cls) -> Self:
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:
Expand Down Expand Up @@ -760,6 +760,14 @@ def create_polls(self) -> int:
"""
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)
Expand Down Expand Up @@ -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]] = {}
Expand Down

0 comments on commit 895d6c3

Please sign in to comment.