import websocket
import json
import pprint
ws = websocket.WebSocket()
ws.connect("wss://gateway.discord.gg/?v=6&encoding=json")
result = ws.recv()
print "Received: ",result
heartbeat = '{"op": 1,"d": 251}'
p = '{"token": "MY_BOT_TOKEN","properties": {"$os": "linux","$browser": "disco","$device": "disco" },"compress": false, "large_threshold": 250,"shard": [0, 1],"presence": {"game": {},"status": "online","since": null,"afk": false}}'
h = json.loads(heartbeat)
h_json = json.dumps(h)
p_load = json.loads(p)
p_json = json.dumps(p_load)
print(h_json)
ws.send(h_json)
result = ws.recv()
print "Received: ",result
ws.send(p_json)
result = ws.recv()
print "Received: ",result