File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -460,13 +460,13 @@ async def __get_all_commands(self) -> None:
460460 # responsible for checking if a command is in the cache but not a coro -> allowing removal
461461
462462 for _id in _guild_ids :
463- _cmds = await self . _http . get_application_commands (
464- application_id = self .me . id , guild_id = _id , with_localizations = True
465- )
466-
467- if isinstance ( _cmds , dict ) and _cmds . get ( "code" ) :
468- if int (_cmds . get ( " code" ) ) != 50001 :
469- raise LibraryException (_cmds [ " code" ] , message = f' { _cmds [ " message" ] } |' )
463+ try :
464+ _cmds = await self ._http . get_application_commands (
465+ application_id = self . me . id , guild_id = _id , with_localizations = True
466+ )
467+ except LibraryException as e :
468+ if int (e . code ) != 50001 :
469+ raise LibraryException (code = e . code , message = e . message )
470470
471471 log .warning (
472472 f"Your bot is missing access to guild with corresponding id { _id } ! "
You can’t perform that action at this time.
0 commit comments