diff options
| author | Tobotimus <[email protected]> | 2018-01-06 17:21:56 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-01-06 17:23:59 -0500 |
| commit | 3112e1c17e7859adf6d13ed844f4c636b4bc30d8 (patch) | |
| tree | 70d7aafca549a8c245ee4fdab774e1ab5302d531 /discord/ext | |
| parent | [commands] Fix MissingRequiredArgument param handling (diff) | |
| download | discord.py-3112e1c17e7859adf6d13ed844f4c636b4bc30d8.tar.xz discord.py-3112e1c17e7859adf6d13ed844f4c636b4bc30d8.zip | |
Add intersphinx
Diffstat (limited to 'discord/ext')
| -rw-r--r-- | discord/ext/commands/bot.py | 18 | ||||
| -rw-r--r-- | discord/ext/commands/context.py | 12 | ||||
| -rw-r--r-- | discord/ext/commands/converter.py | 6 | ||||
| -rw-r--r-- | discord/ext/commands/core.py | 30 | ||||
| -rw-r--r-- | discord/ext/commands/errors.py | 6 | ||||
| -rw-r--r-- | discord/ext/commands/formatter.py | 22 |
6 files changed, 47 insertions, 47 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 1662f422..67853715 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -436,7 +436,7 @@ class BotBase(GroupMixin): Parameters ----------- - func : coroutine + func : :ref:`coroutine <coroutine>` The extra event to listen to. name : Optional[str] The name of the command to use. Defaults to ``func.__name__``. @@ -943,13 +943,13 @@ class Bot(BotBase, discord.Client): command prefixes. This callable can be either a regular function or a coroutine. - The command prefix could also be a list or a tuple indicating that + The command prefix could also be a :class:`list` or a :class:`tuple` indicating that multiple checks for the prefix should be used and the first one to match will be the invocation prefix. You can get this prefix via :attr:`.Context.prefix`. - description : str + description : :class:`str` The content prefixed into the default help message. - self_bot : bool + self_bot : :class:`bool` If ``True``, the bot will only listen to commands invoked by itself rather than ignoring itself. If ``False`` (the default) then the bot will ignore itself. This cannot be changed once initialised. @@ -959,29 +959,29 @@ class Bot(BotBase, discord.Client): If you want to change the help command completely (add aliases, etc) then a call to :meth:`~.Bot.remove_command` with 'help' as the argument would do the trick. - pm_help : Optional[bool] + pm_help : Optional[:class:`bool`] A tribool that indicates if the help command should PM the user instead of sending it to the channel it received it from. If the boolean is set to ``True``, then all help output is PM'd. If ``False``, none of the help output is PM'd. If ``None``, then the bot will only PM when the help message becomes too long (dictated by more than 1000 characters). Defaults to ``False``. - help_attrs : dict + help_attrs : :class:`dict` A dictionary of options to pass in for the construction of the help command. This allows you to change the command behaviour without actually changing the implementation of the command. The attributes will be the same as the ones passed in the :class:`.Command` constructor. Note that ``pass_context`` will always be set to ``True`` regardless of what you pass in. - command_not_found : str + command_not_found : :class:`str` The format string used when the help command is invoked with a command that is not found. Useful for i18n. Defaults to ``"No command called {} found."``. The only format argument is the name of the command passed. - command_has_no_subcommands : str + command_has_no_subcommands : :class:`str` The format string used when the help command is invoked with requests for a subcommand but the command does not have any subcommands. Defaults to ``"Command {0.name} has no subcommands."``. The first format argument is the :class:`.Command` attempted to get a subcommand and the second is the name. - owner_id: Optional[int] + owner_id: Optional[:class:`int`] The ID that owns the bot. If this is not set and is then queried via :meth:`.is_owner` then it is fetched automatically using :meth:`~.Bot.application_info`. diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index c250fc62..303c1051 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -42,32 +42,32 @@ class Context(discord.abc.Messageable): The message that triggered the command being executed. bot: :class:`.Bot` The bot that contains the command being executed. - args: list + 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 then this list could be incomplete. - kwargs: dict + 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. - prefix: str + prefix: :class:`str` The prefix that was used to invoke the command. command The command (i.e. :class:`.Command` or its superclasses) that is being invoked currently. - invoked_with: str + invoked_with: :class:`str` The command name that triggered this invocation. Useful for finding out which alias called the command. invoked_subcommand The subcommand (i.e. :class:`.Command` or its superclasses) that was invoked. If no valid subcommand was invoked then this is equal to `None`. - subcommand_passed: Optional[str] + subcommand_passed: Optional[:class:`str`] The string that was attempted to call a subcommand. This does not have to point to a valid registered subcommand and could just point to a nonsense string. If nothing was passed to attempt a call to a subcommand then this is set to `None`. - command_failed: bool + command_failed: :class:`bool` A boolean that indicates if the command failed to be parsed, checked, or invoked. """ diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 267a7d40..e2397ad2 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -405,11 +405,11 @@ class clean_content(Converter): Attributes ------------ - fix_channel_mentions: bool + fix_channel_mentions: :obj:`bool` Whether to clean channel mentions. - use_nicknames: bool + use_nicknames: :obj:`bool` Whether to use nicknames when transforming mentions. - escape_markdown: bool + escape_markdown: :obj:`bool` Whether to also escape special markdown characters. """ def __init__(self, *, fix_channel_mentions=False, use_nicknames=True, escape_markdown=False): diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 21384a1a..aba9ccf7 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -91,20 +91,20 @@ class Command: Attributes ----------- - name: str + name: :class:`str` The name of the command. - callback: coroutine + callback: :ref:`coroutine <coroutine>` The coroutine that is executed when the command is called. - help: str + help: :class:`str` The long help text for the command. - brief: str + brief: :class:`str` The short help text for the command. If this is not specified then the first line of the long help text is used instead. - usage: str + usage: :class:`str` A replacement for arguments in the default help text. - aliases: list + aliases: :class:`list` The list of aliases the command can be invoked under. - enabled: bool + enabled: :class:`bool` A boolean that indicates if the command is currently enabled. If the command is invoked while it is disabled, then :exc:`.DisabledCommand` is raised to the :func:`.on_command_error` @@ -119,19 +119,19 @@ class Command: :exc:`.CommandError` should be used. Note that if the checks fail then :exc:`.CheckFailure` exception is raised to the :func:`.on_command_error` event. - description: str + description: :class:`str` The message prefixed into the default help command. - hidden: bool + hidden: :class:`bool` If ``True``\, the default help command does not show this in the help output. - rest_is_raw: bool + rest_is_raw: :class:`bool` If ``False`` and a keyword-only argument is provided then the keyword only argument is stripped and handled as if it was a regular argument that handles :exc:`.MissingRequiredArgument` and default values in a regular matter rather than passing the rest completely raw. If ``True`` then the keyword-only argument will pass in the rest of the arguments in a completely raw matter. Defaults to ``False``. - ignore_extra: bool + ignore_extra: :class:`bool` If ``True``\, ignores extraneous strings passed to a command if all its requirements are met (e.g. ``?foo a b c`` when only expecting ``a`` and ``b``). Otherwise :func:`.on_command_error` and local error handlers @@ -519,7 +519,7 @@ class Command: Parameters ----------- - coro + coro : :ref:`coroutine <coroutine>` The coroutine to register as the local error handler. Raises @@ -703,7 +703,7 @@ class GroupMixin: Attributes ----------- - all_commands: dict + all_commands: :class:`dict` A mapping of command name to :class:`.Command` or superclass objects. """ @@ -861,7 +861,7 @@ class Group(GroupMixin, Command): Attributes ----------- - invoke_without_command: bool + invoke_without_command: :class:`bool` Indicates if the group callback should begin parsing and invocation only if no subcommand was found. Useful for making it an error handling function to tell the user that @@ -950,7 +950,7 @@ def command(name=None, cls=None, **attrs): By default the ``help`` attribute is received automatically from the docstring of the function and is cleaned up with the use of ``inspect.cleandoc``. If the docstring is ``bytes``, then it is decoded - into ``str`` using utf-8 encoding. + into :class:`str` using utf-8 encoding. All checks added using the :func:`.check` & co. decorators are added into the function. There is no way to supply your own checks through this diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index 139b75e9..209073c2 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -130,7 +130,7 @@ class CommandOnCooldown(CommandError): cooldown: Cooldown A class with attributes ``rate``, ``per``, and ``type`` similar to the :func:`.cooldown` decorator. - retry_after: float + retry_after: :class:`float` The amount of seconds to wait before you can retry again. """ def __init__(self, cooldown, retry_after): @@ -144,7 +144,7 @@ class MissingPermissions(CheckFailure): Attributes ----------- - missing_perms: list + missing_perms: :class:`list` The required permissions that are missing. """ def __init__(self, missing_perms, *args): @@ -164,7 +164,7 @@ class BotMissingPermissions(CheckFailure): Attributes ----------- - missing_perms: list + missing_perms: :class:`list` The required permissions that are missing. """ def __init__(self, missing_perms, *args): diff --git a/discord/ext/commands/formatter.py b/discord/ext/commands/formatter.py index 8e30f58d..7b9528c4 100644 --- a/discord/ext/commands/formatter.py +++ b/discord/ext/commands/formatter.py @@ -58,11 +58,11 @@ class Paginator: Attributes ----------- - prefix: str + prefix: :class:`str` The prefix inserted to every page. e.g. three backticks. - suffix: str + suffix: :class:`str` The suffix appended at the end of every page. e.g. three backticks. - max_size: int + max_size: :class:`int` The maximum amount of codepoints allowed in a page. """ def __init__(self, prefix='```', suffix='```', max_size=2000): @@ -133,13 +133,13 @@ class HelpFormatter: Attributes ----------- - show_hidden: bool + show_hidden: :class:`bool` Dictates if hidden commands should be shown in the output. Defaults to ``False``. - show_check_failure: bool + show_check_failure: :class:`bool` Dictates if commands that have their :attr:`.Command.checks` failed shown. Defaults to ``False``. - width: int + width: :class:`int` The maximum number of characters that fit in a line. Defaults to 80. """ @@ -149,15 +149,15 @@ class HelpFormatter: self.show_check_failure = show_check_failure def has_subcommands(self): - """bool: Specifies if the command has subcommands.""" + """:class:`bool`: Specifies if the command has subcommands.""" return isinstance(self.command, GroupMixin) def is_bot(self): - """bool: Specifies if the command being formatted is the bot itself.""" + """:class:`bool`: Specifies if the command being formatted is the bot itself.""" return self.command is self.context.bot def is_cog(self): - """bool: Specifies if the command being formatted is actually a cog.""" + """:class:`bool`: Specifies if the command being formatted is actually a cog.""" return not self.is_bot() and not isinstance(self.command, Command) def shorten(self, text): @@ -168,7 +168,7 @@ class HelpFormatter: @property def max_name_size(self): - """int: Returns the largest name length of a command or if it has subcommands + """:class:`int`: Returns the largest name length of a command or if it has subcommands the largest subcommand name.""" try: commands = self.command.all_commands if not self.is_cog() else self.context.bot.all_commands @@ -209,7 +209,7 @@ class HelpFormatter: -------- iterable An iterable with the filter being applied. The resulting value is - a (key, value) tuple of the command name and the command itself. + a (key, value) :class:`tuple` of the command name and the command itself. """ def sane_no_suspension_point_predicate(tup): |