mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(ShardClientUtil): Fix client event names (#9474)
Co-authored-by: GrapeColor <grapecolor@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -32,26 +32,26 @@ class ShardClientUtil {
|
||||
switch (mode) {
|
||||
case 'process':
|
||||
process.on('message', this._handleMessage.bind(this));
|
||||
client.on('ready', () => {
|
||||
client.on(Events.ShardReady, () => {
|
||||
process.send({ _ready: true });
|
||||
});
|
||||
client.on('disconnect', () => {
|
||||
client.on(Events.ShardDisconnect, () => {
|
||||
process.send({ _disconnect: true });
|
||||
});
|
||||
client.on('reconnecting', () => {
|
||||
client.on(Events.ShardReconnecting, () => {
|
||||
process.send({ _reconnecting: true });
|
||||
});
|
||||
break;
|
||||
case 'worker':
|
||||
this.parentPort = require('node:worker_threads').parentPort;
|
||||
this.parentPort.on('message', this._handleMessage.bind(this));
|
||||
client.on('ready', () => {
|
||||
client.on(Events.ShardReady, () => {
|
||||
this.parentPort.postMessage({ _ready: true });
|
||||
});
|
||||
client.on('disconnect', () => {
|
||||
client.on(Events.ShardDisconnect, () => {
|
||||
this.parentPort.postMessage({ _disconnect: true });
|
||||
});
|
||||
client.on('reconnecting', () => {
|
||||
client.on(Events.ShardReconnecting, () => {
|
||||
this.parentPort.postMessage({ _reconnecting: true });
|
||||
});
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user