Skip to content

Commit

Permalink
Merge pull request #102 from therealr5/feature/app-permissions
Browse files Browse the repository at this point in the history
Implement app_permissions
  • Loading branch information
breqdev authored Jul 7, 2022
2 parents 785ea36 + 4e67244 commit 90c47a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flask_discord_interactions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ class Context(LoadableDataclass):
locale
The selected language of the invoking user.
guild_locale
The guild's preferred locale, if invoked in a guild
The guild's preferred locale, if invoked in a guild.
app_permissions
Bitwise set of permissions the app or bot has within the channel the interaction was sent from.
"""

author: Union[Member, User] = None
Expand All @@ -93,7 +95,7 @@ class Context(LoadableDataclass):
message: Message = None
locale: Optional[str] = None
guild_locale: Optional[str] = None

app_permissions: Optional[str] = None
app: Any = None
discord: Any = None

Expand Down Expand Up @@ -132,6 +134,7 @@ def from_data(cls, discord=None, app=None, data={}):
target_id=data.get("data", {}).get("target_id"),
locale=data.get("locale"),
guild_locale=data.get("guild_locale"),
app_permissions=data.get("app_permissions"),
)

result.data = data
Expand Down

0 comments on commit 90c47a2

Please sign in to comment.