Skip to content

Commit

Permalink
Handle user commands when user is not a member
Browse files Browse the repository at this point in the history
(kicked user or in DM)
  • Loading branch information
breqdev committed Jul 10, 2022
1 parent c07053d commit 62ca189
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flask_discord_interactions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ def parse_target(self):
message. This method sets the `ctx.target` field.
"""
if self.type == ApplicationCommandType.USER:
self.target = self.members[self.target_id]
if self.target_id in self.members:
self.target = self.members[self.target_id]
else:
self.target = self.users[self.target_id]
elif self.type == ApplicationCommandType.MESSAGE:
self.target = self.messages[self.target_id]
else:
Expand Down

0 comments on commit 62ca189

Please sign in to comment.