Skip to content

Commit ad679f9

Browse files
authored
fix: warn for no app cmd scope for disable_sync (#1076)
1 parent 3a84a8c commit ad679f9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

interactions/client/bot.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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}! "

0 commit comments

Comments
 (0)