From 8cece19b2220bd6b7f61438219a0b88d0768a079 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 28 Mar 2021 11:07:51 -0400 Subject: Add on_interaction event and Interaction class. This is the first pass at the functionality. It's currently a bit incomplete. --- docs/api.rst | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'docs') diff --git a/docs/api.rst b/docs/api.rst index b328ab22..859f1e25 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -585,6 +585,17 @@ to handle it, which defaults to print a traceback and ignoring the exception. :param payload: The raw event payload data. :type payload: :class:`RawReactionClearEmojiEvent` +.. function:: on_interaction(interaction) + + Called when an interaction happened. + + This currently happens due to slash command invocations. + + .. versionadded:: 2.0 + + :param interaction: The interaction data. + :type interaction: :class:`Interaction` + .. function:: on_private_channel_delete(channel) on_private_channel_create(channel) @@ -1089,6 +1100,20 @@ of :class:`enum.Enum`. .. versionadded:: 1.5 +.. class:: InteractionType + + Specifies the type of :class:`Interaction`. + + .. versionadded:: 2.0 + + .. attribute:: ping + + Represents Discord pinging to see if the interaction response server is alive. + + .. attribute:: application_command + + Represents a slash command interaction. + .. class:: HypeSquadHouse Specifies the HypeSquad house a user belongs to. @@ -2699,6 +2724,14 @@ Integration .. autoclass:: IntegrationAccount() :members: +Interaction +~~~~~~~~~~~~ + +.. attributetable:: Interaction + +.. autoclass:: Interaction() + :members: + Member ~~~~~~ -- cgit v1.2.3