rmcafee / discord_ex

Discord Elixir Library
MIT License
48 stars 13 forks source link

Update for Discord websocket gateway protocol v6 #43

Closed jussih closed 7 years ago

jussih commented 7 years ago

Changes to support Gateway protocol v6 (https://discordapp.com/developers/docs/topics/gateway#gateway-protocol-versions).

Old gateway protocols are deprecated and will stop working on October 16th.

I refactored the heartbeat process to its own module. It can now monitor the new Heartbeat ACK opcode and detect a stale connection if no ack is received during the heartbeat interval.

I also refactored the main websocket handler so it can support all opcodes sent by Discord, in addition to the dispatch op. On top of this it should be possible to implement reconnection and use of the resume op to replay messages that DiscordEx might have missed during disconnection.

Closes #42

rmcafee commented 7 years ago

Thanks @jussih

tielur commented 6 years ago

@rmcafee Can you update hex with this new version?

rmcafee commented 6 years ago

@tielur yeah behind on bumps. I'll update to 1.1.17 when I get a chance.

rmcafee commented 6 years ago

@tielur make that 1.1.18 😉