Skip to content

Commit da8d82c

Browse files
committed
Better check for get_commands
1 parent 00526f7 commit da8d82c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

discord/cog.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,7 @@ def get_commands(self) -> List[ApplicationCommand]:
247247
248248
This does not include subcommands.
249249
"""
250-
return [
251-
c for c in (
252-
c for c in self.__cog_commands__
253-
if not isinstance(c, (SlashCommand, MessageCommand, UserCommand))
254-
) if c.parent is None
255-
] + [
256-
c for c in self.__cog_commands__
257-
if isinstance(c, (SlashCommand, MessageCommand, UserCommand))
258-
]
259-
250+
return [c for c in self.__cog_commands__ if isinstance(c, ApplicationCommand) and c.parent is None]
260251
@property
261252
def qualified_name(self) -> str:
262253
""":class:`str`: Returns the cog's specified name, not the class name."""

0 commit comments

Comments
 (0)