May 25, 2016
I had a bunch of problems getting a discord bot going. Here’s what I did:
Registered an app and set up a bot user. Sign into the gateway (only required once, but it won’t let your bot send messages otherwise). I ran this JS snippet in the console of Chrome: var ws = new WebSocket('wss://gateway.discord.gg'); mystring = JSON.stringify({ "op": 2, "d": { "token": "<bot token>", "properties": { "$os": "linux", "$browser": "sometestingbrowser", "$device": "sometestingdevice", "$referrer": "", "$referring_domain": "", }, "compress": true, "large_threshold": 250, } }) ws.