aboutsummaryrefslogtreecommitdiff
path: root/docs/ext
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-05-12 20:14:34 -0400
committerRapptz <[email protected]>2017-05-12 20:14:34 -0400
commitb44bba6ee6e29b38d1e579c602821582e155ec3b (patch)
tree355df44874b3e5f8ee4e825339cb57783e3677ca /docs/ext
parentRename abc.Callable to abc.Connectable. (diff)
downloaddiscord.py-b44bba6ee6e29b38d1e579c602821582e155ec3b.tar.xz
discord.py-b44bba6ee6e29b38d1e579c602821582e155ec3b.zip
First pass at documentation reform.
Diffstat (limited to 'docs/ext')
-rw-r--r--docs/ext/commands/api.rst197
-rw-r--r--docs/ext/commands/index.rst13
2 files changed, 210 insertions, 0 deletions
diff --git a/docs/ext/commands/api.rst b/docs/ext/commands/api.rst
new file mode 100644
index 00000000..665a2f33
--- /dev/null
+++ b/docs/ext/commands/api.rst
@@ -0,0 +1,197 @@
+.. currentmodule:: discord
+
+API Reference
+===============
+
+The following section outlines the API of discord.py's command extension module.
+
+Bot
+----
+
+.. autoclass:: discord.ext.commands.Bot
+ :members:
+ :inherited-members:
+
+.. autoclass:: discord.ext.commands.AutoShardedBot
+ :members:
+
+Event Reference
+-----------------
+
+These events function similar to :ref:`the regular events <discord-api-events>`, except they
+are custom to the command extension module.
+
+.. function:: on_command_error(ctx, error)
+
+ An error handler that is called when an error is raised
+ inside a command either through user input error, check
+ failure, or an error in your own code.
+
+ A default one is provided (:meth:`.Bot.on_command_error`).
+
+ :param ctx: The invocation context.
+ :type ctx: :class:`Context`
+ :param error: The error that was raised.
+ :type error: :class:`CommandError` derived
+
+.. function:: on_command(ctx)
+
+ An event that is called when a command is found and is about to be invoked.
+
+ This event is called regardless of whether the command itself succeeds via
+ error or completes.
+
+ :param ctx: The invocation context.
+ :type ctx: :class:`Context`
+
+.. function:: on_command_completion(ctx)
+
+ An event that is called when a command has completed its invocation.
+
+ This event is called only if the command succeeded, i.e. all checks have
+ passed and the user input it correctly.
+
+ :param ctx: The invocation context.
+ :type ctx: :class:`Context`
+
+
+Command
+--------
+
+.. autofunction:: discord.ext.commands.command
+
+.. autofunction:: discord.ext.commands.group
+
+.. autoclass:: discord.ext.commands.Command
+ :members:
+
+.. autoclass:: discord.ext.commands.Group
+ :members:
+ :inherited-members:
+
+.. autoclass:: discord.ext.commands.GroupMixin
+ :members:
+
+
+Formatters
+-----------
+
+.. autoclass:: discord.ext.commands.Paginator
+ :members:
+
+.. autoclass:: discord.ext.commands.HelpFormatter
+ :members:
+
+Checks
+-------
+
+.. autofunction:: discord.ext.commands.check
+
+.. autofunction:: discord.ext.commands.has_role
+
+.. autofunction:: discord.ext.commands.has_permissions
+
+.. autofunction:: discord.ext.commands.has_any_role
+
+.. autofunction:: discord.ext.commands.bot_has_role
+
+.. autofunction:: discord.ext.commands.bot_has_permissions
+
+.. autofunction:: discord.ext.commands.bot_has_any_role
+
+.. autofunction:: discord.ext.commands.cooldown
+
+.. autofunction:: discord.ext.commands.guild_only
+
+.. autofunction:: discord.ext.commands.is_owner
+
+.. autofunction:: discord.ext.commands.is_nsfw
+
+Context
+--------
+
+.. autoclass:: discord.ext.commands.Context
+ :members:
+ :exclude-members: history typing
+
+ .. autocomethod:: discord.ext.commands.Context.history
+ :async-for:
+
+ .. autocomethod:: discord.ext.commands.Context.typing
+ :async-with:
+
+Converters
+------------
+
+.. autoclass:: discord.ext.commands.Converter
+ :members:
+
+.. autoclass:: discord.ext.commands.MemberConverter
+ :members:
+
+.. autoclass:: discord.ext.commands.UserConverter
+ :members:
+
+.. autoclass:: discord.ext.commands.TextChannelConverter
+ :members:
+
+.. autoclass:: discord.ext.commands.InviteConverter
+ :members:
+
+.. autoclass:: discord.ext.commands.RoleConverter
+ :members:
+
+.. autoclass:: discord.ext.commands.GameConverter
+ :members:
+
+.. autoclass:: discord.ext.commands.ColourConverter
+ :members:
+
+.. autoclass:: discord.ext.commands.VoiceChannelConverter
+ :members:
+
+.. autoclass:: discord.ext.commands.EmojiConverter
+ :members:
+
+.. autoclass:: discord.ext.commands.clean_content
+ :members:
+
+Errors
+-------
+
+.. autoexception:: discord.ext.commands.CommandError
+ :members:
+
+.. autoexception:: discord.ext.commands.MissingRequiredArgument
+ :members:
+
+.. autoexception:: discord.ext.commands.BadArgument
+ :members:
+
+.. autoexception:: discord.ext.commands.NoPrivateMessage
+ :members:
+
+.. autoexception:: discord.ext.commands.CheckFailure
+ :members:
+
+.. autoexception:: discord.ext.commands.CommandNotFound
+ :members:
+
+.. autoexception:: discord.ext.commands.DisabledCommand
+ :members:
+
+.. autoexception:: discord.ext.commands.CommandInvokeError
+ :members:
+
+.. autoexception:: discord.ext.commands.TooManyArguments
+ :members:
+
+.. autoexception:: discord.ext.commands.UserInputError
+ :members:
+
+.. autoexception:: discord.ext.commands.CommandOnCooldown
+ :members:
+
+.. autoexception:: discord.ext.commands.NotOwner
+ :members:
+
diff --git a/docs/ext/commands/index.rst b/docs/ext/commands/index.rst
new file mode 100644
index 00000000..908a7bc1
--- /dev/null
+++ b/docs/ext/commands/index.rst
@@ -0,0 +1,13 @@
+``discord.ext.commands`` -- Bot commands framework
+====================================================
+
+``discord.py`` offers a lower level aspect on interacting with Discord. Often times, the library is used for the creation of
+bots. However this task can be daunting and confusing to get correctly the first time. Many times there comes a repetition in
+creating a bot command framework that is extensible, flexible, and powerful. For this reason, ``discord.py`` comes with an
+extension library that handles this for you.
+
+
+.. toctree::
+ :maxdepth: 1
+
+ api