File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
packages/discord.js/src/sharding Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,12 @@ class Shard extends EventEmitter {
367
367
return ;
368
368
}
369
369
370
+ // Shard has resumed
371
+ if ( message . _resume ) {
372
+ this . ready = true ;
373
+ return ;
374
+ }
375
+
370
376
// Shard is requesting a property fetch
371
377
if ( message . _sFetchProp ) {
372
378
const resp = { _sFetchProp : message . _sFetchProp , _sFetchPropShard : message . _sFetchPropShard } ;
Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ class ShardClientUtil {
42
42
client . on ( Events . ShardReconnecting , ( ) => {
43
43
process . send ( { _reconnecting : true } ) ;
44
44
} ) ;
45
+ client . on ( Events . ShardResume , ( ) => {
46
+ process . send ( { _resume : true } ) ;
47
+ } ) ;
45
48
break ;
46
49
case 'worker' :
47
50
this . parentPort = require ( 'node:worker_threads' ) . parentPort ;
@@ -55,6 +58,9 @@ class ShardClientUtil {
55
58
client . on ( Events . ShardReconnecting , ( ) => {
56
59
this . parentPort . postMessage ( { _reconnecting : true } ) ;
57
60
} ) ;
61
+ client . on ( Events . ShardResume , ( ) => {
62
+ this . parentPort . postMessage ( { _resume : true } ) ;
63
+ } ) ;
58
64
break ;
59
65
}
60
66
}
You can’t perform that action at this time.
0 commit comments