File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -572,13 +572,15 @@ async def sync_commands(
572
572
# Permissions (Roles will be converted to IDs just before Upsert for Global Commands)
573
573
global_permissions .append ({"id" : i ["id" ], "permissions" : cmd .permissions })
574
574
575
- for guild_id , guild_data in registered_guild_commands .items ():
576
- commands = registered_guild_commands [guild_id ]
575
+ for guild_id , commands in registered_guild_commands .items ():
577
576
guild_permissions : List = []
578
577
579
578
for i in commands :
580
579
cmd = find (lambda cmd : cmd .name == i ["name" ] and cmd .type == i ["type" ] and cmd .guild_ids is not None
581
580
and (i ["guild_id" ]) in cmd .guild_ids , self .pending_application_commands )
581
+ if not cmd :
582
+ # command has not been added yet
583
+ continue
582
584
cmd .id = i ["id" ]
583
585
self ._application_commands [cmd .id ] = cmd
584
586
You can’t perform that action at this time.
0 commit comments