Skip to content

Commit

Permalink
fix!: Allow usage of builtin json instead of orjson (#595)
Browse files Browse the repository at this point in the history
* fix!: fix EmbedImageStruct serialization

* fix!: Button emoji serialization

* fix!: message serialization in context

* fix!: only encode data if data is bytes

* fix!: typo
  • Loading branch information
EdVraz committed Mar 1, 2022
1 parent 385c926 commit 7897743
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 7897743

Please sign in to comment.