Skip to content

Commit 23c2b36

Browse files
committed
missing registered command fix
1 parent 696d617 commit 23c2b36

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

discord/bot.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,12 @@ async def register_commands(self) -> None:
299299
guild_ids=None,
300300
type=i["type"],
301301
)
302-
cmd.id = i["id"]
303-
self._application_commands[cmd.id] = cmd
302+
if cmd:
303+
cmd.id = i["id"]
304+
self._application_commands[cmd.id] = cmd
304305

305-
# Permissions (Roles will be converted to IDs just before Upsert for Global Commands)
306-
global_permissions.append({"id": i["id"], "permissions": cmd.permissions})
306+
# Permissions (Roles will be converted to IDs just before Upsert for Global Commands)
307+
global_permissions.append({"id": i["id"], "permissions": cmd.permissions})
307308

308309
update_guild_commands = {}
309310
async for guild in self.fetch_guilds(limit=None):

0 commit comments

Comments
 (0)