diff --git a/interactions/api/gateway.py b/interactions/api/gateway.py index 5f73550b7..992ad353b 100644 --- a/interactions/api/gateway.py +++ b/interactions/api/gateway.py @@ -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) diff --git a/interactions/api/http.py b/interactions/api/http.py index 015f1ece2..0dcfcf58f 100644 --- a/interactions/api/http.py +++ b/interactions/api/http.py @@ -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. diff --git a/interactions/context.py b/interactions/context.py index d23776956..9884d21a6 100644 --- a/interactions/context.py +++ b/interactions/context.py @@ -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, @@ -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,