diff --git a/disnake/ext/commands/interaction_bot_base.py b/disnake/ext/commands/interaction_bot_base.py index 5f4bb7e5e3..b2868f53dc 100644 --- a/disnake/ext/commands/interaction_bot_base.py +++ b/disnake/ext/commands/interaction_bot_base.py @@ -258,7 +258,8 @@ def command_sync_flags(self) -> CommandSyncFlags: @property def all_app_commands(self) -> MappingProxyType[AppCmdIndex, InvokableApplicationCommand]: """MappingProxyType[:class:`AppCmdIndex`, :class:`InvokableApplicationCommand`]: - A mapping proxy with all application commands the bot has.""" + A mapping proxy with all application commands the bot has. + """ return MappingProxyType(self._all_app_commands) @property @@ -357,11 +358,8 @@ def add_app_command(self, app_command: InvokableApplicationCommand) -> None: "not an instance of SubCommand or SubCommandGroup" ) - if app_command.guild_ids is None: - # if test_guilds are specified then we add the same command for each test guild - guild_ids = (None,) if self._test_guilds is None else self._test_guilds - else: - guild_ids = app_command.guild_ids + test_guilds = (None,) if self._test_guilds is None else self._test_guilds + guild_ids = app_command.guild_ids or test_guilds for guild_id in guild_ids: cmd_index = AppCmdIndex(