aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHornwitser <[email protected]>2015-10-16 14:16:17 +0200
committerRapptz <[email protected]>2015-10-16 16:20:04 -0400
commit023e0eb1d5df5ade0ce5f0350b09e10500077d0e (patch)
treee37cc377e4d8dc0de69fdafd700ea55f1b680a33
parentAdd events for sniffing the WebSocket data (diff)
downloaddiscord.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.py4
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):