Skip to content

Commit eae2de8

Browse files
authored
Refactor + Docs change
1 parent 34a4dea commit eae2de8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

discord/cog.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,24 @@ def get_commands(self) -> List[ApplicationCommand]:
239239
r"""
240240
Returns
241241
--------
242-
List[:class:`.Command`]
243-
A :class:`list` of :class:`.Command`\s that are
242+
List[:class:`.ApplicationCommand`]
243+
A :class:`list` of :class:`.ApplicationCommand`\s that are
244244
defined inside this cog.
245245
246246
.. note::
247247
248248
This does not include subcommands.
249249
"""
250-
return [c for c in (c for c in self.__cog_commands__ if not isinstance(c, (SlashCommand, MessageCommand, UserCommand))) if c.parent is None] + [c for c in self.__cog_commands__ if isinstance(c, (SlashCommand, MessageCommand, UserCommand))]
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+
[
257+
c for c in self.__cog_commands__
258+
if isinstance(c, (SlashCommand, MessageCommand, UserCommand))
259+
]
251260

252261
@property
253262
def qualified_name(self) -> str:

0 commit comments

Comments
 (0)