diff --git a/packages/discord.js/src/client/websocket/WebSocketManager.js b/packages/discord.js/src/client/websocket/WebSocketManager.js index 02e494953f3a..8e5456d77bb5 100644 --- a/packages/discord.js/src/client/websocket/WebSocketManager.js +++ b/packages/discord.js/src/client/websocket/WebSocketManager.js @@ -296,14 +296,14 @@ class WebSocketManager extends EventEmitter { shard.ping = latency; }); - this._ws.on(WSWebSocketShardEvents.Error, err => { + this._ws.on(WSWebSocketShardEvents.Error, ({ error, shardId }) => { /** * Emitted whenever a shard's WebSocket encounters a connection error. * @event Client#shardError * @param {Error} error The encountered error * @param {number} shardId The shard that encountered this error */ - this.client.emit(Events.ShardError, err, err.shardId); + this.client.emit(Events.ShardError, error, shardId); }); }