Skip to content

Commit 385c926

Browse files
authored
fix!: message serialization in context (#590)
* fix!: fix EmbedImageStruct serialization * fix!: Button emoji serialization * fix!: message serialization in context
1 parent 1489e4f commit 385c926

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

interactions/api/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2301,7 +2301,7 @@ async def delete_interaction_response(
23012301
webhook_id=int(application_id), webhook_token=token, message_id=message_id
23022302
)
23032303

2304-
async def _post_followup(self, data: dict, token: str, application_id: str) -> None:
2304+
async def _post_followup(self, data: dict, token: str, application_id: str) -> dict:
23052305
"""
23062306
Send a followup to an interaction.
23072307

interactions/context.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,13 @@ async def send(self, content: Optional[str] = MISSING, **kwargs) -> Message:
458458
application_id=str(self.application_id),
459459
)
460460
self.responded = True
461-
self.message = msg = Message(**res, _client=self.client)
462461
else:
463-
await self.client._post_followup(
462+
res = await self.client._post_followup(
464463
data=payload._json,
465464
token=self.token,
466465
application_id=str(self.application_id),
467466
)
467+
self.message = msg = Message(**res, _client=self.client)
468468
else:
469469
await self.client.create_interaction_response(
470470
token=self.token,
@@ -638,13 +638,14 @@ async def send(self, content: Optional[str] = MISSING, **kwargs) -> Message:
638638
application_id=str(self.application_id),
639639
)
640640
self.responded = True
641-
self.message = msg = Message(**res, _client=self.client)
642641
else:
643-
await self.client._post_followup(
642+
res = await self.client._post_followup(
644643
data=payload._json,
645644
token=self.token,
646645
application_id=str(self.application_id),
647646
)
647+
self.message = msg = Message(**res, _client=self.client)
648+
648649
else:
649650
await self.client.create_interaction_response(
650651
token=self.token,

0 commit comments

Comments
 (0)