aboutsummaryrefslogtreecommitdiff
path: root/docs/api.rst
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-04-25 04:57:29 -0400
committerRapptz <[email protected]>2021-05-27 00:53:13 -0400
commit98570793e4af8dcfca25621e86fecd85297b0d59 (patch)
treeefcbe97935fa61126c642f00fdd3ebbc15b61375 /docs/api.rst
parentFix bug in Embed.__len__ caused by footer without text (diff)
downloaddiscord.py-98570793e4af8dcfca25621e86fecd85297b0d59.tar.xz
discord.py-98570793e4af8dcfca25621e86fecd85297b0d59.zip
Add initial support for buttons and components
Diffstat (limited to 'docs/api.rst')
-rw-r--r--docs/api.rst111
1 files changed, 110 insertions, 1 deletions
diff --git a/docs/api.rst b/docs/api.rst
index bac81d32..5c869822 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -1172,10 +1172,66 @@ of :class:`enum.Enum`.
.. attribute:: ping
Represents Discord pinging to see if the interaction response server is alive.
-
.. attribute:: application_command
Represents a slash command interaction.
+ .. attribute:: component
+
+ Represents a component based interaction, i.e. using the Discord Bot UI Kit.
+
+.. class:: InteractionResponseType
+
+ Specifies the response type for the interaction.
+
+ .. versionadded:: 2.0
+
+ .. attribute:: pong
+
+ Pongs the interaction when given a ping.
+ .. attribute:: channel_message
+
+ Respond to a slash command with a message.
+ .. attribute:: deferred_channel_message
+
+ Responds to a slash command with a message at a later time.
+ .. attribute:: ack
+
+ Acknowledges the component interaction.
+
+.. class:: ComponentType
+
+ Represents the component type of a component.
+
+ .. versionadded:: 2.0
+
+ .. attribute:: group
+
+ Represents the group component which holds different components.
+ .. attribute:: button
+
+ Represents a button component.
+
+.. class:: ButtonStyle
+
+ Represents the style of the button component.
+
+ .. versionadded:: 2.0
+
+ .. attribute:: blurple::
+
+ Represents a blurple button.
+ .. attribute:: grey::
+
+ Represents a grey button.
+ .. attribute:: green::
+
+ Represents a green button.
+ .. attribute:: red::
+
+ Represents a red button.
+ .. attribute:: hyperlink::
+
+ Represents a hyperlink button.
.. class:: VoiceRegion
@@ -2794,6 +2850,24 @@ Message
.. autoclass:: Message()
:members:
+Component
+~~~~~~~~~~
+
+.. attributetable:: Component
+
+.. autoclass:: Component()
+ :members:
+
+Button
+~~~~~~~
+
+.. attributetable:: Button
+
+.. autoclass:: Button()
+ :members:
+ :inherited-members:
+
+
DeletedReferencedMessage
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -3327,6 +3401,41 @@ PublicUserFlags
.. autoclass:: PublicUserFlags()
:members:
+.. _discord_ui_kit:
+
+Bot UI Kit
+-------------
+
+The library has helpers to help create component-based UIs.
+
+View
+~~~~~~~
+
+.. attributetable:: discord.ui.View
+
+.. autoclass:: discord.ui.View
+ :members:
+
+Item
+~~~~~~~
+
+.. attributetable:: discord.ui.Item
+
+.. autoclass:: discord.ui.Item
+ :members:
+
+Button
+~~~~~~~
+
+.. attributetable:: discord.ui.Button
+
+.. autoclass:: discord.ui.Button
+ :members:
+ :inherited-members:
+
+.. autofunction:: discord.ui.button
+
+
Exceptions
------------