Skip to content

Commit 7897743

Browse files
authored
fix!: Allow usage of builtin json instead of orjson (#595)
* fix!: fix EmbedImageStruct serialization * fix!: Button emoji serialization * fix!: message serialization in context * fix!: only encode data if data is bytes * fix!: typo
1 parent 385c926 commit 7897743

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

interactions/api/gateway.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ async def _send_packet(self, data: Dict[str, Any]) -> None:
556556
:type data: Dict[str, Any]
557557
"""
558558
self._last_send = perf_counter()
559-
packet: str = dumps(data).decode("utf-8") if isinstance(data, dict) else data
559+
_data = dumps(data) if isinstance(data, dict) else data
560+
packet: str = _data.decode("utf-8") if isinstance(_data, bytes) else _data
560561
await self._client.send_str(packet)
561562
log.debug(packet)
562563

0 commit comments

Comments
 (0)