diff --git a/interactions/client/bot.py b/interactions/client/bot.py index 8ab1dfefe..38791c24b 100644 --- a/interactions/client/bot.py +++ b/interactions/client/bot.py @@ -460,13 +460,13 @@ async def __get_all_commands(self) -> None: # responsible for checking if a command is in the cache but not a coro -> allowing removal for _id in _guild_ids: - _cmds = await self._http.get_application_commands( - application_id=self.me.id, guild_id=_id, with_localizations=True - ) - - if isinstance(_cmds, dict) and _cmds.get("code"): - if int(_cmds.get("code")) != 50001: - raise LibraryException(_cmds["code"], message=f'{_cmds["message"]} |') + try: + _cmds = await self._http.get_application_commands( + application_id=self.me.id, guild_id=_id, with_localizations=True + ) + except LibraryException as e: + if int(e.code) != 50001: + raise LibraryException(code=e.code, message=e.message) log.warning( f"Your bot is missing access to guild with corresponding id {_id}! "