mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-21 03:57:26 +00:00
Gateway: Fixed Invalid Session retrying forever bug
This commit is contained in:
parent
536018b5f8
commit
a2a1ccd01e
|
@ -151,8 +151,12 @@ func HandleOP(g *Gateway, op *OP) error {
|
||||||
// Discord expects us to sleep for no reason
|
// Discord expects us to sleep for no reason
|
||||||
time.Sleep(time.Duration(rand.Intn(5)+1) * time.Second)
|
time.Sleep(time.Duration(rand.Intn(5)+1) * time.Second)
|
||||||
|
|
||||||
// Invalid session, respond with Identify.
|
// Invalid session, try and Identify.
|
||||||
return g.Identify()
|
if err := g.Identify(); err != nil {
|
||||||
|
// Can't identify, reconnect.
|
||||||
|
go g.Reconnect()
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
|
||||||
case HelloOP:
|
case HelloOP:
|
||||||
// What is this OP doing here???
|
// What is this OP doing here???
|
||||||
|
|
Loading…
Reference in a new issue