From 62ca189495926832e962024e5e64f82a6ac60639 Mon Sep 17 00:00:00 2001 From: Brooke Chalmers Date: Sun, 10 Jul 2022 12:40:13 -0400 Subject: [PATCH] Handle user commands when user is not a member (kicked user or in DM) --- flask_discord_interactions/context.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flask_discord_interactions/context.py b/flask_discord_interactions/context.py index 7898824..462f305 100644 --- a/flask_discord_interactions/context.py +++ b/flask_discord_interactions/context.py @@ -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: