Skip to content

Commit

Permalink
fix(ShardClientUtil): Fix client event names (#9474)
Browse files Browse the repository at this point in the history
Co-authored-by: GrapeColor <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 30, 2023
1 parent 1ba7394 commit ad217cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/discord.js/src/sharding/ShardClientUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ad217cc

Please sign in to comment.