Skip to content
This repository was archived by the owner on Aug 28, 2019. It is now read-only.

Commit 7b1c57e

Browse files
committed
Add support for interaction followups
1 parent 2ebd531 commit 7b1c57e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

discord/interactions.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from .member import Member
3636
from .message import Message, Attachment
3737
from .object import Object
38-
from .webhook.async_ import async_context
38+
from .webhook.async_ import async_context, Webhook
3939

4040
__all__ = (
4141
'Interaction',
@@ -100,6 +100,7 @@ class Interaction:
100100
'_state',
101101
'_session',
102102
'_cs_response',
103+
'_cs_followup',
103104
)
104105

105106
def __init__(self, *, data: InteractionPayload, state: ConnectionState):
@@ -158,6 +159,16 @@ def response(self) -> InteractionResponse:
158159
""":class:`InteractionResponse`: Returns an object responsible for handling responding to the interaction."""
159160
return InteractionResponse(self)
160161

162+
@utils.cached_slot_property('_cs_followup')
163+
def followup(self) -> Webhook:
164+
""":class:`Webhook`: Returns the follow up webhook for follow up interactions."""
165+
payload = {
166+
'id': self.application_id,
167+
'type': 3,
168+
'token': self.token,
169+
}
170+
return Webhook.from_state(data=payload, state=self._state)
171+
161172

162173
class InteractionResponse:
163174
"""Represents a Discord interaction response.

0 commit comments

Comments
 (0)