Skip to content

Commit 8a5aa3b

Browse files
committed
Fixed error at SlashContext initialization if only command is added to guild
Note: `.author` will be `discord.User`, not Member
1 parent fb76d7d commit 8a5aa3b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

discord_slash/context.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def __init__(self,
5353
self.channel_id = int(_json["channel_id"])
5454
if self.guild:
5555
self.author = discord.Member(data=_json["member"], state=self.bot._connection, guild=self.guild)
56+
elif self.guild_id:
57+
self.author = discord.User(data=_json["member"]["user"], state=self.bot._connection)
5658
else:
5759
self.author = discord.User(data=_json["user"], state=self.bot._connection)
5860

0 commit comments

Comments
 (0)