Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion interactions/api/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ async def _send_packet(self, data: Dict[str, Any]) -> None:
:type data: Dict[str, Any]
"""
self._last_send = perf_counter()
packet: str = dumps(data).decode("utf-8") if isinstance(data, dict) else data
_data = dumps(data) if isinstance(data, dict) else data
packet: str = _data.decode("utf-8") if isinstance(_data, bytes) else _data
await self._client.send_str(packet)
log.debug(packet)

Expand Down
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