File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,26 @@ def response(self) -> InteractionResponse:
134
134
135
135
@property
136
136
def respond (self ):
137
- return self .followup .send if self .response .is_done () else self .interaction .response .send_message
137
+ if not self .response .is_done ():
138
+ return self .interaction .response .send_message
139
+ else :
140
+ raise RuntimeError (f"Interaction was already issued a response. Try using { type (self ).__name__ } .send_followup() instead." )
141
+
142
+ @property
143
+ async def send_response (self ) -> Callable [..., Union [Interaction , Webhook ]]:
144
+ """Callable[..., Union[:class:`~.Interaction`, :class:`~.Webhook`]]: Sends either a response
145
+ or a followup response depending if the interaction has been responded to yet or not."""
146
+ if not self .response .is_done ():
147
+ return self .interaction .response .send_message # self.response
148
+ else :
149
+ return self .followup .send # self.send_followup
150
+
151
+ @property
152
+ def send_followup (self ):
153
+ if self .response .is_done ():
154
+ return self .followup .send
155
+ else :
156
+ raise RuntimeError (f"Interaction was not yet issued a response. Try using { type (self ).__name__ } .respond() first." )
138
157
139
158
@property
140
159
def defer (self ):
You can’t perform that action at this time.
0 commit comments