mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-20 19:47:12 +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
|
||||
time.Sleep(time.Duration(rand.Intn(5)+1) * time.Second)
|
||||
|
||||
// Invalid session, respond with Identify.
|
||||
return g.Identify()
|
||||
// Invalid session, try and Identify.
|
||||
if err := g.Identify(); err != nil {
|
||||
// Can't identify, reconnect.
|
||||
go g.Reconnect()
|
||||
}
|
||||
return nil
|
||||
|
||||
case HelloOP:
|
||||
// What is this OP doing here???
|
||||
|
|
Loading…
Reference in a new issue