Skip to content

Commit

Permalink
fix!: message serialization in context (#590)
Browse files Browse the repository at this point in the history
* fix!: fix EmbedImageStruct serialization

* fix!: Button emoji serialization

* fix!: message serialization in context
  • Loading branch information
EdVraz committed Mar 1, 2022
1 parent 1489e4f commit 385c926
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion interactions/api/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2301,7 +2301,7 @@ async def delete_interaction_response(
webhook_id=int(application_id), webhook_token=token, message_id=message_id
)

async def _post_followup(self, data: dict, token: str, application_id: str) -> None:
async def _post_followup(self, data: dict, token: str, application_id: str) -> dict:
"""
Send a followup to an interaction.
Expand Down
9 changes: 5 additions & 4 deletions interactions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,13 @@ async def send(self, content: Optional[str] = MISSING, **kwargs) -> Message:
application_id=str(self.application_id),
)
self.responded = True
self.message = msg = Message(**res, _client=self.client)
else:
await self.client._post_followup(
res = await self.client._post_followup(
data=payload._json,
token=self.token,
application_id=str(self.application_id),
)
self.message = msg = Message(**res, _client=self.client)
else:
await self.client.create_interaction_response(
token=self.token,
Expand Down Expand Up @@ -638,13 +638,14 @@ async def send(self, content: Optional[str] = MISSING, **kwargs) -> Message:
application_id=str(self.application_id),
)
self.responded = True
self.message = msg = Message(**res, _client=self.client)
else:
await self.client._post_followup(
res = await self.client._post_followup(
data=payload._json,
token=self.token,
application_id=str(self.application_id),
)
self.message = msg = Message(**res, _client=self.client)

else:
await self.client.create_interaction_response(
token=self.token,
Expand Down

0 comments on commit 385c926

Please sign in to comment.