diff options
| author | Hornwitser <[email protected]> | 2015-10-16 14:16:17 +0200 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-10-16 16:20:04 -0400 |
| commit | 023e0eb1d5df5ade0ce5f0350b09e10500077d0e (patch) | |
| tree | e37cc377e4d8dc0de69fdafd700ea55f1b680a33 | |
| parent | Add events for sniffing the WebSocket data (diff) | |
| download | discord.py-023e0eb1d5df5ade0ce5f0350b09e10500077d0e.tar.xz discord.py-023e0eb1d5df5ade0ce5f0350b09e10500077d0e.zip | |
Use compact encoding for json on websocket
Remove extra whitespace from json encoding used when sending messages on
the websocket.
| -rw-r--r-- | discord/client.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py index 5d29de7e..f4f473a4 100644 --- a/discord/client.py +++ b/discord/client.py @@ -70,7 +70,7 @@ class KeepAliveHandler(threading.Thread): msg = 'Keeping websocket alive with timestamp {0}' log.debug(msg.format(payload['d'])) - self.socket.send(json.dumps(payload)) + self.socket.send(json.dumps(payload, separators=(',', ':'))) class WebSocket(WebSocketBaseClient): def __init__(self, dispatch, url): @@ -436,7 +436,7 @@ class Client(object): } } - self.ws.send(json.dumps(second_payload)) + self.ws.send(json.dumps(second_payload, separators=(',', ':'))) def _resolve_mentions(self, content, mentions): if isinstance(mentions, list): |