diff options
| author | Rapptz <[email protected]> | 2021-04-25 04:57:29 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-05-27 00:53:13 -0400 |
| commit | 98570793e4af8dcfca25621e86fecd85297b0d59 (patch) | |
| tree | efcbe97935fa61126c642f00fdd3ebbc15b61375 /docs | |
| parent | Fix bug in Embed.__len__ caused by footer without text (diff) | |
| download | discord.py-98570793e4af8dcfca25621e86fecd85297b0d59.tar.xz discord.py-98570793e4af8dcfca25621e86fecd85297b0d59.zip | |
Add initial support for buttons and components
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api.rst | 111 |
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 ------------ |