aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-05-30 11:25:15 -0400
committerRapptz <[email protected]>2021-05-30 11:25:15 -0400
commit7b1c57ed607df8c3096413ba9d5d760a7204e862 (patch)
treeaddbe1a60dd93a35eca7d678e0738fd71c3eed2e
parentAdd support for sending and editing views in Webhook (diff)
downloaddiscord.py-7b1c57ed607df8c3096413ba9d5d760a7204e862.tar.xz
discord.py-7b1c57ed607df8c3096413ba9d5d760a7204e862.zip
Add support for interaction followups
-rw-r--r--discord/interactions.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/discord/interactions.py b/discord/interactions.py
index 9fd85e60..eb20030e 100644
--- a/discord/interactions.py
+++ b/discord/interactions.py
@@ -35,7 +35,7 @@ from .user import User
from .member import Member
from .message import Message, Attachment
from .object import Object
-from .webhook.async_ import async_context
+from .webhook.async_ import async_context, Webhook
__all__ = (
'Interaction',
@@ -100,6 +100,7 @@ class Interaction:
'_state',
'_session',
'_cs_response',
+ '_cs_followup',
)
def __init__(self, *, data: InteractionPayload, state: ConnectionState):
@@ -158,6 +159,16 @@ class Interaction:
""":class:`InteractionResponse`: Returns an object responsible for handling responding to the interaction."""
return InteractionResponse(self)
+ @utils.cached_slot_property('_cs_followup')
+ def followup(self) -> Webhook:
+ """:class:`Webhook`: Returns the follow up webhook for follow up interactions."""
+ payload = {
+ 'id': self.application_id,
+ 'type': 3,
+ 'token': self.token,
+ }
+ return Webhook.from_state(data=payload, state=self._state)
+
class InteractionResponse:
"""Represents a Discord interaction response.