Fix various inconsistencies within the documentation (#5067)

This commit is contained in:
Sebastian Law
2020-06-28 00:45:58 -07:00
committed by GitHub
parent f94b00cb48
commit b4b953bfc6
24 changed files with 378 additions and 142 deletions

View File

@ -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