File tree Expand file tree Collapse file tree 1 file changed +6
-23
lines changed Expand file tree Collapse file tree 1 file changed +6
-23
lines changed Original file line number Diff line number Diff line change @@ -188,29 +188,12 @@ async def register_commands(self) -> None:
188
188
to_update = update_guild_commands [guild_id ]
189
189
update_guild_commands [guild_id ] = to_update + [as_dict ]
190
190
191
- for guild_id , value in update_guild_commands .items ():
192
- if value :
193
- try :
194
- cmds = await self .http .bulk_upsert_guild_commands (
195
- self .user .id , guild_id , value
196
- )
197
- except Forbidden as e :
198
- if "Missing Access" in e .args [0 ]:
199
- print (
200
- f"Bot is missing access to create application commands in this guild: { guild_id } ."
201
- )
202
- continue # raising an error causes the function to stop but the bot still runs
203
- else :
204
- raise e
205
-
206
- for i in cmds :
207
- cmd = get (
208
- self .to_register ,
209
- name = i ["name" ],
210
- description = i ["description" ],
211
- type = i ["type" ],
212
- )
213
- self .app_commands [i ["id" ]] = cmd
191
+ for guild_id in update_guild_commands :
192
+ cmds = await self .http .bulk_upsert_guild_commands (self .user .id , guild_id ,
193
+ update_guild_commands [guild_id ])
194
+ for i in cmds :
195
+ cmd = get (self .to_register , name = i ["name" ], description = i ["description" ], type = i ['type' ])
196
+ self .app_commands [i ["id" ]] = cmd
214
197
215
198
cmds = await self .http .bulk_upsert_global_commands (self .user .id , commands )
216
199
You can’t perform that action at this time.
0 commit comments