Added on_heartbeat_req because op 1 is actually bidirectional and the gw can request an heartbeat from us
Changed default WS close code from 1005 to 4000. This should help keeping the session alive on the discord side. Other discord libs also use 4000 and it was suggested to me in the API discord too
Heartbeating now starts as soon as we have the hearbeat_interval, even if we don't have a sequence yet (sending null is allowed/recommended in this case)
Allow resuming after an Invalid Session if the gw indicates it is resumable by sending d: true (the json bool comparison is untested, may or may not work)
Moved storing the sequence number to on_dispatch because only op 0 payloads contain it
Remove two old parameters from the Ident hash in send_ident
on_heartbeat_req
becauseop 1
is actually bidirectional and the gw can request an heartbeat from ushearbeat_interval
, even if we don't have a sequence yet (sendingnull
is allowed/recommended in this case)d: true
(the json bool comparison is untested, may or may not work)on_dispatch
because onlyop 0
payloads contain itsend_ident