Skip to content

Commit

Permalink
feat: cache channel data from interactions (#1479)
Browse files Browse the repository at this point in the history
  • Loading branch information
AstreaTSS authored Jul 15, 2023
1 parent e828fb5 commit d7bcfba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions interactions/models/internal/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ def from_dict(cls, client: "interactions.Client", payload: dict) -> Self:
instance.resolved = Resolved.from_dict(client, payload["data"].get("resolved", {}), payload.get("guild_id"))

instance.channel_id = Snowflake(payload["channel_id"])
if channel := payload.get("channel"):
client.cache.place_channel_data(channel)

if member := payload.get("member"):
instance.author_id = Snowflake(member["user"]["id"])
instance.guild_id = Snowflake(payload["guild_id"])
Expand Down

0 comments on commit d7bcfba

Please sign in to comment.