Skip to content

Commit fa45f8e

Browse files
committed
Added author menu list check.
1 parent f8aa1d0 commit fa45f8e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

discord_slash/context.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,13 @@ def __init__(
6262
self._deferred_hidden = False # To check if the patch to the deferred response matches
6363
self.guild_id = int(_json["guild_id"]) if "guild_id" in _json.keys() else None
6464
if self.guild and self._author_menus_id:
65-
self.author_menus = discord.Member(
66-
data=_json["data"]["resolved"]["members"],
67-
state=self.bot._connection,
68-
guild=self.guild,
69-
)
70-
elif self.guild_id:
71-
self.author_menus = discord.User(
72-
data=_json["data"]["resolved"]["user"], state=self.bot._connection
73-
)
65+
self.author_menus = []
66+
for user in self._author_menus_id:
67+
self.author.menus.append(
68+
discord.Member(
69+
data=self._author_menus_id[user], state=self.bot._connection
70+
)
71+
)
7472
else:
7573
self.author_menus = None
7674
self.author_id = int(

0 commit comments

Comments
 (0)