diff options
| author | Josh <[email protected]> | 2021-05-06 21:51:07 +1000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-06 07:51:07 -0400 |
| commit | 3864fb37a0814345913c7ca4fd1978fa5e2ef7e2 (patch) | |
| tree | e5a411b6e35fe3485381880a40223cc574d5e2e9 /discord/ext/commands | |
| parent | Typehint emoji classes (diff) | |
| download | discord.py-3864fb37a0814345913c7ca4fd1978fa5e2ef7e2.tar.xz discord.py-3864fb37a0814345913c7ca4fd1978fa5e2ef7e2.zip | |
Fix various reference issues in documentation
Co-Authored-By: Riley Shaw <[email protected]>
Diffstat (limited to 'discord/ext/commands')
| -rw-r--r-- | discord/ext/commands/bot.py | 4 | ||||
| -rw-r--r-- | discord/ext/commands/cog.py | 2 | ||||
| -rw-r--r-- | discord/ext/commands/context.py | 4 | ||||
| -rw-r--r-- | discord/ext/commands/converter.py | 2 | ||||
| -rw-r--r-- | discord/ext/commands/core.py | 6 | ||||
| -rw-r--r-- | discord/ext/commands/errors.py | 8 | ||||
| -rw-r--r-- | discord/ext/commands/help.py | 11 |
7 files changed, 18 insertions, 19 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 4ab5ee35..1d5cd7bc 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -220,7 +220,7 @@ class BotBase(GroupMixin): The function that was used as a global check. call_once: :class:`bool` If the function should only be called once per - :meth:`.Command.invoke` call. + :meth:`.invoke` call. """ if call_once: @@ -253,7 +253,7 @@ class BotBase(GroupMixin): r"""A decorator that adds a "call once" global check to the bot. Unlike regular global checks, this one is called only once - per :meth:`.Command.invoke` call. + per :meth:`.invoke` call. Regular global checks are called whenever a command is called or :meth:`.Command.can_run` is called. This type of check diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 085bdb97..bda1b696 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -334,7 +334,7 @@ class Cog(metaclass=CogMeta): @_cog_special_method def cog_check(self, ctx): - """A special method that registers as a :func:`commands.check` + """A special method that registers as a :func:`~discord.ext.commands.check` for every command and subcommand in this cog. This function **can** be a coroutine and must take a sole parameter, diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index 9699261d..0f3c546e 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -47,12 +47,12 @@ class Context(discord.abc.Messageable): The bot that contains the command being executed. args: :class:`list` The list of transformed arguments that were passed into the command. - If this is accessed during the :func:`on_command_error` event + If this is accessed during the :func:`.on_command_error` event then this list could be incomplete. kwargs: :class:`dict` A dictionary of transformed arguments that were passed into the command. Similar to :attr:`args`\, if this is accessed in the - :func:`on_command_error` event then this dict could be incomplete. + :func:`.on_command_error` event then this dict could be incomplete. current_parameter: Optional[:class:`inspect.Parameter`] The parameter that is currently being inspected and converted. This is only of use for within converters. diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 1f1828b1..1beba307 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -516,7 +516,7 @@ class ColourConverter(Converter[discord.Colour]): - ``#<hex>`` - ``0x#<hex>`` - ``rgb(<number>, <number>, <number>)`` - - Any of the ``classmethod`` in :class:`Colour` + - Any of the ``classmethod`` in :class:`~discord.Colour` - The ``_`` in the name can be optionally replaced with spaces. diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index cb986e3b..a736debb 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -908,9 +908,9 @@ class Command(_BaseCommand): def short_doc(self): """:class:`str`: Gets the "short" documentation of a command. - By default, this is the :attr:`brief` attribute. + By default, this is the :attr:`.brief` attribute. If that lookup leads to an empty string then the first line of the - :attr:`help` attribute is used instead. + :attr:`.help` attribute is used instead. """ if self.brief is not None: return self.brief @@ -979,7 +979,7 @@ class Command(_BaseCommand): """|coro| Checks if the command can be executed by checking all the predicates - inside the :attr:`checks` attribute. This also checks whether the + inside the :attr:`~Command.checks` attribute. This also checks whether the command is disabled. .. versionchanged:: 1.3 diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index a624cf5f..ecca00b4 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -89,7 +89,7 @@ class CommandError(DiscordException): This exception and exceptions inherited from it are handled in a special way as they are caught and passed into a special event - from :class:`.Bot`\, :func:`on_command_error`. + from :class:`.Bot`\, :func:`.on_command_error`. """ def __init__(self, message=None, *args): if message is not None: @@ -457,7 +457,7 @@ class CommandOnCooldown(CommandError): Attributes ----------- - cooldown: Cooldown + cooldown: ``Cooldown`` A class with attributes ``rate``, ``per``, and ``type`` similar to the :func:`.cooldown` decorator. retry_after: :class:`float` @@ -654,7 +654,7 @@ class BadUnionArgument(UserInputError): ----------- param: :class:`inspect.Parameter` The parameter that failed being converted. - converters: Tuple[Type, ...] + converters: Tuple[Type, ``...``] A tuple of converters attempted in conversion, in order of failure. errors: List[:class:`CommandError`] A list of errors that were caught from failing the conversion. @@ -692,7 +692,7 @@ class BadLiteralArgument(UserInputError): ----------- param: :class:`inspect.Parameter` The parameter that failed being converted. - literals: Tuple[Any, ...] + literals: Tuple[Any, ``...``] A tuple of values compared against in conversion, in order of failure. errors: List[:class:`CommandError`] A list of errors that were caught from failing the conversion. diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py index 4dd1e745..6de81bb5 100644 --- a/discord/ext/commands/help.py +++ b/discord/ext/commands/help.py @@ -277,9 +277,9 @@ class HelpCommand: Defaults to ``False``. verify_checks: Optional[:class:`bool`] Specifies if commands should have their :attr:`.Command.checks` called - and verified. If ``True``, always calls :attr:`.Commands.checks`. - If ``None``, only calls :attr:`.Commands.checks` in a guild setting. - If ``False``, never calls :attr:`.Commands.checks`. Defaults to ``True``. + and verified. If ``True``, always calls :attr:`.Command.checks`. + If ``None``, only calls :attr:`.Command.checks` in a guild setting. + If ``False``, never calls :attr:`.Command.checks`. Defaults to ``True``. .. versionchanged:: 1.7 command_attrs: :class:`dict` @@ -615,8 +615,7 @@ class HelpCommand: """|coro| Handles the implementation when an error happens in the help command. - For example, the result of :meth:`command_not_found` or - :meth:`command_has_no_subcommand_found` will be passed here. + For example, the result of :meth:`command_not_found` will be passed here. You can override this method to customise the behaviour. @@ -949,7 +948,7 @@ class DefaultHelpCommand(HelpCommand): if the list of commands is greater than 0. max_size: Optional[:class:`int`] The max size to use for the gap between indents. - If unspecified, calls :meth:`get_max_size` on the + If unspecified, calls :meth:`~HelpCommand.get_max_size` on the commands parameter. """ |