Skip to content

Commit

Permalink
feat: Fill Context.user from member data if user data is not given (#591
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Catalyst4222 authored Feb 28, 2022
1 parent f992dd2 commit 1f8cafa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion interactions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ def __init__(self, **kwargs) -> None:
Member(**self.member, _client=self.client) if self._json.get("member") else None
)
self.author = self.member
self.user = User(**self.user) if self._json.get("user") else None
if self._json.get("user"):
self.user = User(**self.user)
elif self.member:
self.user = self.member.user
else:
self.user = None

self.id = Snowflake(self.id) if self._json.get("id") else None
self.application_id = (
Expand Down

0 comments on commit 1f8cafa

Please sign in to comment.