File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -191,16 +191,25 @@ async def register_commands(self) -> None:
191
191
to_update = update_guild_commands [guild_id ]
192
192
update_guild_commands [guild_id ] = to_update + [as_dict ]
193
193
194
+ raised_error = None
195
+ raised_guilds = []
194
196
for guild_id in update_guild_commands :
195
197
try :
196
198
cmds = await self .http .bulk_upsert_guild_commands (self .user .id , guild_id ,
197
199
update_guild_commands [guild_id ])
198
- except Forbidden :
199
- print ( f'Ignoring exception running bulk_upsert_guild_commands on guild { guild_id } ' , file = sys . stderr )
200
- traceback . print_exc ( )
200
+ except Forbidden as e :
201
+ raised_error = e
202
+ raised_guilds . append ( guild_id )
201
203
for i in cmds :
202
204
cmd = get (self .to_register , name = i ["name" ], description = i ["description" ], type = i ['type' ])
203
205
self .app_commands [i ["id" ]] = cmd
206
+ if raised_error :
207
+ try :
208
+ raise raised_error
209
+ except Forbidden :
210
+ print (f'Ignoring exception running bulk_upsert_guild_commands on guilds { raised_guilds } ' ,
211
+ file = sys .stderr )
212
+ traceback .print_exc ()
204
213
205
214
cmds = await self .http .bulk_upsert_global_commands (self .user .id , commands )
206
215
You can’t perform that action at this time.
0 commit comments