diff --git a/discord/interactions.py b/discord/interactions.py index 3f9be13ce..f2b9ac6a9 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -133,6 +133,7 @@ class Interaction: 'guild_locale', 'extras', '_permissions', + '_app_permissions', '_state', '_client', '_session', @@ -182,6 +183,7 @@ class Interaction: self.user: Union[User, Member] = MISSING self._permissions: int = 0 + self._app_permissions: int = int(data.get('app_permissions', 0)) if self.guild_id: guild = self._state._get_or_create_unavailable_guild(self.guild_id) @@ -236,6 +238,11 @@ class Interaction: """ return Permissions(self._permissions) + @property + def app_permissions(self) -> Permissions: + """:class:`Permissions`: The resolved permissions of the application or the bot, including overwrites.""" + return Permissions(self._app_permissions) + @utils.cached_slot_property('_cs_namespace') def namespace(self) -> Namespace: """:class:`app_commands.Namespace`: The resolved namespace for this interaction. diff --git a/discord/types/interactions.py b/discord/types/interactions.py index b5ab32cac..42f71898f 100644 --- a/discord/types/interactions.py +++ b/discord/types/interactions.py @@ -203,6 +203,7 @@ class _BaseInteraction(TypedDict): version: Literal[1] guild_id: NotRequired[Snowflake] channel_id: NotRequired[Snowflake] + app_permissions: NotRequired[str] locale: NotRequired[str] guild_locale: NotRequired[str]