diff options
Diffstat (limited to 'discord/ext/commands/cog.py')
| -rw-r--r-- | discord/ext/commands/cog.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 5c81e4a5..b8e25917 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -72,7 +72,7 @@ class CogMeta(type): The cog name. By default, it is the name of the class with no modification. command_attrs: :class:`dict` A list of attributes to apply to every command inside this cog. The dictionary - is passed into the :class:`Command` (or its subclass) options at ``__init__``. + is passed into the :class:`Command` options at ``__init__``. If you specify attributes inside the command attribute in the class, it will override the one specified inside this attribute. For example: @@ -188,12 +188,16 @@ class Cog(metaclass=CogMeta): return self def get_commands(self): - r"""Returns a :class:`list` of :class:`.Command`\s that are - defined inside this cog. + r""" + Returns + -------- + List[:class:`.Command`] + A :class:`list` of :class:`.Command`\s that are + defined inside this cog. - .. note:: + .. note:: - This does not include subcommands. + This does not include subcommands. """ return [c for c in self.__cog_commands__ if c.parent is None] @@ -221,7 +225,13 @@ class Cog(metaclass=CogMeta): yield from command.walk_commands() def get_listeners(self): - """Returns a :class:`list` of (name, function) listener pairs that are defined in this cog.""" + """Returns a :class:`list` of (name, function) listener pairs that are defined in this cog. + + Returns + -------- + List[Tuple[:class:`str`, :ref:`coroutine <coroutine>`]] + The listeners defined in this cog. + """ return [(name, getattr(self, method_name)) for name, method_name in self.__cog_listeners__] @classmethod |