Making guild_ids checking in cog_ext more concise.
@@ -58,8 +58,7 @@ def cog_slash(
else:
opts = options
- if guild_ids is not None:
- if not all(isinstance(item, int) for item in guild_ids):
+ if guild_ids and not all(isinstance(item, int) for item in guild_ids):
raise IncorrectGuildIDType(
f"The snowflake IDs {guild_ids} given are not a list of integers. Because of discord.py convention, please use integer IDs instead. Furthermore, the command '{name or cmd.__name__}' will be deactivated and broken until fixed."
)
@@ -147,8 +146,7 @@ def cog_subcommand(
else:
opts = options
- if guild_ids is not None:
- if not all(isinstance(item, int) for item in guild_ids):
+ if guild_ids and not all(isinstance(item, int) for item in guild_ids):
raise IncorrectGuildIDType(
f"The snowflake IDs {guild_ids} given are not a list of integers. Because of discord.py convention, please use integer IDs instead. Furthermore, the command '{name or cmd.__name__}' will be deactivated and broken until fixed."
)
