- {% endif %}
-{% endblock %}
-
-
+
+
+
+
+
+
{{ title|striptags|e }}{{ titlesuffix }}
+ {%- block extrahead %} {% endblock %}
+
+
+
+
+
+ {%- block css %}
+ {%- for css in css_files %}
+ {%- if css|attr("filename") %}
+ {{ css_tag(css) }}
+ {%- else %}
+
+ {%- endif %}
+ {%- endfor %}
+ {%- endblock %}
+ {%- block scripts %}
+
+ {%- for js in script_files %}
+ {{ js_tag(js) }}
+ {%- endfor %}
+ {%- endblock %}
+ {%- if pageurl %}
+
+ {%- endif %}
+ {%- if favicon %}
+
+ {%- endif %}
+ {%- block linktags %}
+ {%- if hasdoc('about') %}
+
+ {%- endif %}
+ {%- if hasdoc('genindex') %}
+
+ {%- endif %}
+ {%- if hasdoc('search') %}
+
+ {%- endif %}
+ {%- if hasdoc('copyright') %}
+
+ {%- endif %}
+ {%- if next %}
+
+ {%- endif %}
+ {%- if prev %}
+
+ {%- endif %}
+ {%- endblock %}
+
+
+{%- block header %}{% endblock %}
+
+ {#- The main navigation header #}
+
+ {#- The sub-header with search and extension related selection #}
+
+ {#- The sidebar component #}
+
+ {%- if display_toc %}
+
+ menu
+
+ {%- endif %}
+
+ settings
+
+
+
+ {#- The actual body of the contents #}
+
+ {% block body %} {% endblock %}
+
{%- block footer %}
-
- {% if pagename == 'index' %}
-
- {% endif %}
-
{%- if READTHEDOCS %}
+
{%- endif %}
-{%- endblock %}
+
+
+
+
+
diff --git a/docs/api.rst b/docs/api.rst
index d697b4f3..6f232190 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -30,48 +30,108 @@ There are two main ways to query version information about the library. For guar
A string representation of the version. e.g. ``'1.0.0rc1'``. This is based
off of :pep:`440`.
+Clients
+--------
+
Client
--------
+~~~~~~~
+
+.. attributetable:: Client
.. autoclass:: Client
:members:
+AutoShardedClient
+~~~~~~~~~~~~~~~~~~
+
+.. attributetable:: AutoShardedClient
+
.. autoclass:: AutoShardedClient
:members:
+Application Info
+------------------
+
+AppInfo
+~~~~~~~~
+
+.. attributetable:: AppInfo
+
.. autoclass:: AppInfo()
:members:
+Team
+~~~~~
+
+.. attributetable:: Team
+
.. autoclass:: Team()
:members:
+TeamMember
+~~~~~~~~~~~
+
+.. attributetable:: TeamMember
+
.. autoclass:: TeamMember()
:members:
-Voice
-------
+Voice Related
+---------------
+
+VoiceClient
+~~~~~~~~~~~~
+
+.. attributetable:: VoiceClient
.. autoclass:: VoiceClient()
:members:
-.. autoclass:: VoiceProtocol
- :members:
+AudioSource
+~~~~~~~~~~~~
+
+.. attributetable:: AudioSource
.. autoclass:: AudioSource
:members:
+PCMAudio
+~~~~~~~~~
+
+.. attributetable:: PCMAudio
+
.. autoclass:: PCMAudio
:members:
+FFmpegAudio
+~~~~~~~~~~~~
+
+.. attributetable:: FFmpegAudio
+
.. autoclass:: FFmpegAudio
:members:
+FFmpegPCMAudio
+~~~~~~~~~~~~~~~
+
+.. attributetable:: FFmpegPCMAudio
+
.. autoclass:: FFmpegPCMAudio
:members:
+FFmpegOpusAudio
+~~~~~~~~~~~~~~~~
+
+.. attributetable:: FFmpegOpusAudio
+
.. autoclass:: FFmpegOpusAudio
:members:
+PCMVolumeTransformer
+~~~~~~~~~~~~~~~~~~~~~
+
+.. attributetable:: PCMVolumeTransformer
+
.. autoclass:: PCMVolumeTransformer
:members:
@@ -2036,9 +2096,19 @@ Working with :meth:`Guild.audit_logs` is a complicated process with a lot of mac
involved. The library attempts to make it easy to use and friendly. In order to accomplish
this goal, it must make use of a couple of data classes that aid in this goal.
+AuditLogEntry
+~~~~~~~~~~~~~~~
+
+.. attributetable:: AuditLogEntry
+
.. autoclass:: AuditLogEntry
:members:
+AuditLogChanges
+~~~~~~~~~~~~~~~~~
+
+.. attributetable:: AuditLogChanges
+
.. class:: AuditLogChanges
An audit log change set.
@@ -2083,6 +2153,11 @@ this goal, it must make use of a couple of data classes that aid in this goal.
| ``None`` | No attributes are set. |
+----------------------------------------+--------------------------------------------------+
+AuditLogDiff
+~~~~~~~~~~~~~
+
+.. attributetable:: AuditLogDiff
+
.. class:: AuditLogDiff
Represents an audit log "change" object. A change object has dynamic
@@ -2428,6 +2503,8 @@ Webhook Support
discord.py offers support for creating, editing, and executing webhooks through the :class:`Webhook` class.
+.. attributetable:: Webhook
+
.. autoclass:: Webhook
:members:
@@ -2459,18 +2536,43 @@ They are mainly there for usage with :func:`py:isinstance` and :func:`py:issubcl
This library has a module related to abstract base classes, some of which are actually from the :doc:`abc
` standard
module, others which are not.
+Snowflake
+~~~~~~~~~~
+
+.. attributetable:: discord.abc.Snowflake
+
.. autoclass:: discord.abc.Snowflake
:members:
+User
+~~~~~
+
+.. attributetable:: discord.abc.User
+
.. autoclass:: discord.abc.User
:members:
+PrivateChannel
+~~~~~~~~~~~~~~~
+
+.. attributetable:: discord.abc.PrivateChannel
+
.. autoclass:: discord.abc.PrivateChannel
:members:
+GuildChannel
+~~~~~~~~~~~~~
+
+.. attributetable:: discord.abc.GuildChannel
+
.. autoclass:: discord.abc.GuildChannel
:members:
+Messageable
+~~~~~~~~~~~~
+
+.. attributetable:: discord.abc.Messageable
+
.. autoclass:: discord.abc.Messageable
:members:
:exclude-members: history, typing
@@ -2481,6 +2583,11 @@ module, others which are not.
.. automethod:: discord.abc.Messageable.typing
:async-with:
+Connectable
+~~~~~~~~~~~~
+
+.. attributetable:: discord.abc.Connectable
+
.. autoclass:: discord.abc.Connectable
.. _discord_api_models:
@@ -2513,6 +2620,8 @@ the user of the library.
ClientUser
~~~~~~~~~~~~
+.. attributetable:: ClientUser
+
.. autoclass:: ClientUser()
:members:
:inherited-members:
@@ -2520,12 +2629,16 @@ ClientUser
Relationship
~~~~~~~~~~~~~~
+.. attributetable:: Relationship
+
.. autoclass:: Relationship()
:members:
User
~~~~~
+.. attributetable:: User
+
.. autoclass:: User()
:members:
:inherited-members:
@@ -2540,24 +2653,32 @@ User
Attachment
~~~~~~~~~~~
+.. attributetable:: Attachment
+
.. autoclass:: Attachment()
:members:
Asset
~~~~~
+.. attributetable:: Asset
+
.. autoclass:: Asset()
:members:
Message
~~~~~~~
+.. attributetable:: Message
+
.. autoclass:: Message()
:members:
Reaction
~~~~~~~~~
+.. attributetable:: Reaction
+
.. autoclass:: Reaction()
:members:
:exclude-members: users
@@ -2568,18 +2689,24 @@ Reaction
CallMessage
~~~~~~~~~~~~
+.. attributetable:: CallMessage
+
.. autoclass:: CallMessage()
:members:
GroupCall
~~~~~~~~~~
+.. attributetable:: GroupCall
+
.. autoclass:: GroupCall()
:members:
Guild
~~~~~~
+.. attributetable:: Guild
+
.. autoclass:: Guild()
:members:
:exclude-members: audit_logs
@@ -2599,6 +2726,8 @@ Integration
Member
~~~~~~
+.. attributetable:: Member
+
.. autoclass:: Member()
:members:
:inherited-members:
@@ -2613,36 +2742,48 @@ Member
Spotify
~~~~~~~~
+.. attributetable:: Spotify
+
.. autoclass:: Spotify()
:members:
VoiceState
~~~~~~~~~~~
+.. attributetable:: VoiceState
+
.. autoclass:: VoiceState()
:members:
Emoji
~~~~~
+.. attributetable:: Emoji
+
.. autoclass:: Emoji()
:members:
PartialEmoji
~~~~~~~~~~~~~~~~~~~~~~
+.. attributetable:: PartialEmoji
+
.. autoclass:: PartialEmoji()
:members:
Role
~~~~~
+.. attributetable:: Role
+
.. autoclass:: Role()
:members:
TextChannel
~~~~~~~~~~~~
+.. attributetable:: TextChannel
+
.. autoclass:: TextChannel()
:members:
:inherited-members:
@@ -2657,6 +2798,8 @@ TextChannel
VoiceChannel
~~~~~~~~~~~~~
+.. attributetable:: VoiceChannel
+
.. autoclass:: VoiceChannel()
:members:
:inherited-members:
@@ -2664,6 +2807,8 @@ VoiceChannel
CategoryChannel
~~~~~~~~~~~~~~~~~
+.. attributetable:: CategoryChannel
+
.. autoclass:: CategoryChannel()
:members:
:inherited-members:
@@ -2671,6 +2816,8 @@ CategoryChannel
DMChannel
~~~~~~~~~
+.. attributetable:: DMChannel
+
.. autoclass:: DMChannel()
:members:
:inherited-members:
@@ -2685,6 +2832,8 @@ DMChannel
GroupChannel
~~~~~~~~~~~~
+.. attributetable:: GroupChannel
+
.. autoclass:: GroupChannel()
:members:
:inherited-members:
@@ -2699,18 +2848,24 @@ GroupChannel
PartialInviteGuild
~~~~~~~~~~~~~~~~~~~
+.. attributetable:: PartialInviteGuild
+
.. autoclass:: PartialInviteGuild()
:members:
PartialInviteChannel
~~~~~~~~~~~~~~~~~~~~~
+.. attributetable:: PartialInviteChannel
+
.. autoclass:: PartialInviteChannel()
:members:
Invite
~~~~~~~
+.. attributetable:: Invite
+
.. autoclass:: Invite()
:members:
@@ -2723,12 +2878,16 @@ Template
WidgetChannel
~~~~~~~~~~~~~~~
+.. attributetable:: WidgetChannel
+
.. autoclass:: WidgetChannel()
:members:
WidgetMember
~~~~~~~~~~~~~
+.. attributetable:: WidgetMember
+
.. autoclass:: WidgetMember()
:members:
:inherited-members:
@@ -2736,6 +2895,8 @@ WidgetMember
Widget
~~~~~~~
+.. attributetable:: Widget
+
.. autoclass:: Widget()
:members:
@@ -2747,36 +2908,48 @@ MessageReference
RawMessageDeleteEvent
~~~~~~~~~~~~~~~~~~~~~~~
+.. attributetable:: RawMessageDeleteEvent
+
.. autoclass:: RawMessageDeleteEvent()
:members:
RawBulkMessageDeleteEvent
~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. attributetable:: RawBulkMessageDeleteEvent
+
.. autoclass:: RawBulkMessageDeleteEvent()
:members:
RawMessageUpdateEvent
~~~~~~~~~~~~~~~~~~~~~~
+.. attributetable:: RawMessageUpdateEvent
+
.. autoclass:: RawMessageUpdateEvent()
:members:
RawReactionActionEvent
~~~~~~~~~~~~~~~~~~~~~~~
+.. attributetable:: RawReactionActionEvent
+
.. autoclass:: RawReactionActionEvent()
:members:
RawReactionClearEvent
~~~~~~~~~~~~~~~~~~~~~~
+.. attributetable:: RawReactionClearEvent
+
.. autoclass:: RawReactionClearEvent()
:members:
RawReactionClearEmojiEvent
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. attributetable:: RawReactionClearEmojiEvent
+
.. autoclass:: RawReactionClearEmojiEvent()
:members:
@@ -2807,12 +2980,16 @@ Object
Embed
~~~~~~
+.. attributetable:: Embed
+
.. autoclass:: Embed
:members:
AllowedMentions
~~~~~~~~~~~~~~~~~
+.. attributetable:: AllowedMentions
+
.. autoclass:: AllowedMentions
:members:
@@ -2831,54 +3008,72 @@ MemberCacheFlags
File
~~~~~
+.. attributetable:: File
+
.. autoclass:: File
:members:
Colour
~~~~~~
+.. attributetable:: Colour
+
.. autoclass:: Colour
:members:
BaseActivity
~~~~~~~~~~~~~~
+.. attributetable:: BaseActivity
+
.. autoclass:: BaseActivity
:members:
Activity
~~~~~~~~~
+.. attributetable:: Activity
+
.. autoclass:: Activity
:members:
Game
~~~~~
+.. attributetable:: Game
+
.. autoclass:: Game
:members:
Streaming
~~~~~~~~~~~
+.. attributetable:: Streaming
+
.. autoclass:: Streaming
:members:
CustomActivity
~~~~~~~~~~~~~~~
+.. attributetable:: CustomActivity
+
.. autoclass:: CustomActivity
:members:
Permissions
~~~~~~~~~~~~
+.. attributetable:: Permissions
+
.. autoclass:: Permissions
:members:
PermissionOverwrite
~~~~~~~~~~~~~~~~~~~~
+.. attributetable:: PermissionOverwrite
+
.. autoclass:: PermissionOverwrite
:members:
diff --git a/docs/conf.py b/docs/conf.py
index d87049ac..40edda29 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -38,7 +38,8 @@ extensions = [
'sphinx.ext.napoleon',
'sphinxcontrib_trio',
'details',
- 'exception_hierarchy'
+ 'exception_hierarchy',
+ 'attributetable',
]
autodoc_member_order = 'bysource'
@@ -143,6 +144,14 @@ html_experimental_html5_writer = True
# a list of builtin themes.
html_theme = 'basic'
+html_context = {
+ 'discord_invite': 'https://discord.gg/r3sSKJJ',
+ 'discord_extensions': [
+ ('discord.ext.commands', 'ext/commands'),
+ ('discord.ext.tasks', 'ext/tasks'),
+ ],
+}
+
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
@@ -166,7 +175,7 @@ html_theme = 'basic'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
-#html_favicon = None
+html_favicon = './images/discord_py_logo.ico'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
@@ -233,6 +242,13 @@ html_static_path = ['_static']
# implements a search results scorer. If empty, the default will be used.
html_search_scorer = '_static/scorer.js'
+html_js_files = [
+ 'custom.js',
+ 'settings.js',
+ 'copy.js',
+ 'sidebar.js'
+]
+
# Output file base name for HTML help builder.
htmlhelp_basename = 'discord.pydoc'
@@ -318,6 +334,6 @@ texinfo_documents = [
#texinfo_no_detailmenu = False
def setup(app):
- app.add_js_file('custom.js')
if app.config.language == 'ja':
app.config.intersphinx_mapping['py'] = ('https://docs.python.org/ja/3', None)
+ app.config.html_context['discord_invite'] = 'https://discord.gg/nXzj3dg'
diff --git a/docs/extensions/attributetable.py b/docs/extensions/attributetable.py
new file mode 100644
index 00000000..9af83981
--- /dev/null
+++ b/docs/extensions/attributetable.py
@@ -0,0 +1,241 @@
+from sphinx.util.docutils import SphinxDirective
+from sphinx.locale import _
+from docutils import nodes
+from sphinx import addnodes
+
+from collections import OrderedDict, namedtuple
+import importlib
+import inspect
+import os
+import re
+
+class attributetable(nodes.General, nodes.Element):
+ pass
+
+class attributetablecolumn(nodes.General, nodes.Element):
+ pass
+
+class attributetabletitle(nodes.TextElement):
+ pass
+
+class attributetableplaceholder(nodes.General, nodes.Element):
+ pass
+
+class attributetablebadge(nodes.TextElement):
+ pass
+
+class attributetable_item(nodes.Part, nodes.Element):
+ pass
+
+def visit_attributetable_node(self, node):
+ self.body.append('' % node['python-class'])
+
+def visit_attributetablecolumn_node(self, node):
+ self.body.append(self.starttag(node, 'div', CLASS='py-attribute-table-column'))
+
+def visit_attributetabletitle_node(self, node):
+ self.body.append(self.starttag(node, 'span'))
+
+def visit_attributetablebadge_node(self, node):
+ attributes = {
+ 'class': 'py-attribute-table-badge',
+ 'title': node['badge-type'],
+ }
+ self.body.append(self.starttag(node, 'span', **attributes))
+
+def visit_attributetable_item_node(self, node):
+ self.body.append(self.starttag(node, 'li', CLASS='py-attribute-table-entry'))
+
+def depart_attributetable_node(self, node):
+ self.body.append('
')
+
+def depart_attributetablecolumn_node(self, node):
+ self.body.append(' ')
+
+def depart_attributetabletitle_node(self, node):
+ self.body.append('')
+
+def depart_attributetablebadge_node(self, node):
+ self.body.append('')
+
+def depart_attributetable_item_node(self, node):
+ self.body.append('')
+
+_name_parser_regex = re.compile(r'(?P