Skip to content

Commit 875e6fa

Browse files
committed
Making guild_ids checking in cog_ext more concise.
1 parent c84d301 commit 875e6fa

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

discord_slash/cog_ext.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,10 @@ def wrapper(cmd):
5858
else:
5959
opts = options
6060

61-
if guild_ids is not None:
62-
if not all(isinstance(item, int) for item in guild_ids):
63-
raise IncorrectGuildIDType(
64-
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."
65-
)
61+
if guild_ids and not all(isinstance(item, int) for item in guild_ids):
62+
raise IncorrectGuildIDType(
63+
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."
64+
)
6665

6766
_cmd = {
6867
"func": cmd,
@@ -147,11 +146,10 @@ def wrapper(cmd):
147146
else:
148147
opts = options
149148

150-
if guild_ids is not None:
151-
if not all(isinstance(item, int) for item in guild_ids):
152-
raise IncorrectGuildIDType(
153-
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."
154-
)
149+
if guild_ids and not all(isinstance(item, int) for item in guild_ids):
150+
raise IncorrectGuildIDType(
151+
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."
152+
)
155153

156154
_cmd = {
157155
"func": None,

0 commit comments

Comments
 (0)