Commit e19a10b 1 parent 970fddb commit e19a10b Copy full SHA for e19a10b
File tree 1 file changed +2
-5
lines changed
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ const MAX_NONCE = 2 ** 32
15
15
const MAX_TIMESTAMP = 2 ** 32
16
16
const MAX_SEQUENCE = 2 ** 16
17
17
const DISCORD_CLOSE_CODES = {
18
+ 1006 : { reconnect : true } ,
18
19
4014 : { error : false } ,
19
- 4015 : { reconnect : true } ,
20
+ 4015 : { reconnect : true }
20
21
}
21
22
22
23
const ssrcs = { }
@@ -289,7 +290,6 @@ class Connection extends EventEmitter {
289
290
const closeCode = DISCORD_CLOSE_CODES [ code ]
290
291
291
292
if ( closeCode ?. reconnect ) {
292
- this . _updateState ( { status : 'disconnected' , reason : 'websocketClose' , code } )
293
293
this . _updatePlayerState ( { status : 'idle' , reason : 'reconnecting' } )
294
294
295
295
this . emit ( 'reconnecting' , reason )
@@ -299,9 +299,6 @@ class Connection extends EventEmitter {
299
299
} else {
300
300
this . _destroy ( { status : 'disconnected' , reason : 'websocketClose' , code } )
301
301
302
- if ( closeCode ?. error !== false )
303
- this . emit ( 'error' , new Error ( reason || `WebSocket closed with code: ${ code } ` ) )
304
-
305
302
return ;
306
303
}
307
304
} )
You can’t perform that action at this time.
0 commit comments