Skip to content

Commit 0877b23

Browse files
authored
fix(BaseInteraction): only edit_interaction_response when it's first deffered response
fix(BaseInteraction): do only edit_interaction_response when it's the first deffered response, otherwise send followup
1 parent cd7e014 commit 0877b23

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

discord/interactions.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -627,14 +627,25 @@ async def respond(self,
627627
flags.suppress_embeds = True
628628
data['flags'] = flags.value
629629
if self.deferred and self.callback_message and self.callback_message.flags.loading:
630-
method = state.http.edit_interaction_response(
631-
token=self._token,
632-
interaction_id=self.id,
633-
application_id=self._application_id,
634-
data=data,
635-
files=files,
636-
deferred=self.deferred
637-
)
630+
if not self.messages:
631+
method = state.http.edit_interaction_response(
632+
token=self._token,
633+
interaction_id=self.id,
634+
application_id=self._application_id,
635+
data=data,
636+
files=files,
637+
deferred=self.deferred
638+
)
639+
else:
640+
method = state.http.send_interaction_response(
641+
token=self._token,
642+
interaction_id=self.id,
643+
application_id=self._application_id,
644+
data=data,
645+
files=files,
646+
followup=True,
647+
deferred=self.deferred,
648+
)
638649
else:
639650
if not self.callback_message:
640651
method = state.http.send_interaction_response(

0 commit comments

Comments
 (0)