Skip to content

Commit c157e8f

Browse files
committed
Refactor clusterClient.ts to export ShardingClient and ShardingClientSapphire
1 parent a6036ef commit c157e8f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/core/clusterClient.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { ClusterClientEvents, EvalOptions, MessageTypes, Serialized, Awaitable, ValidIfSerializable, SerializableInput, ClusterClientData } from '../types';
22
import { BaseMessage, BaseMessageInput, DataType, ProcessMessage } from '../other/message';
33
import { BrokerMessage, IPCBrokerClient } from '../handlers/broker';
4+
import { ShardingClient, ShardingClientSapphire } from './client';
45
import { ClusterClientHandler } from '../handlers/message';
56
import { ShardingUtils } from '../other/shardingUtils';
67
import { RefClusterManager } from './clusterManager';
78
import { PromiseHandler } from '../handlers/promise';
89
import { WorkerClient } from '../classes/worker';
910
import { ChildClient } from '../classes/child';
1011
import { Serializable } from 'child_process';
11-
import { ShardingClient } from './client';
1212
import { getInfo } from '../other/data';
1313
import { Guild } from 'discord.js';
1414
import EventEmitter from 'events';
1515

16-
export type RefShardingClient = ShardingClient;
16+
export type RefShardingClient = ShardingClient | ShardingClientSapphire;
1717

1818
/**
1919
* Simplified Cluster instance available on the {@link ClusterClient}.
@@ -85,7 +85,8 @@ export class ClusterClient<
8585
this.process.ipc.on('message', this._handleMessage.bind(this));
8686
this.promise = new PromiseHandler(this);
8787

88-
if (client?.once) client.once('ready', () => {
88+
// @ts-ignore
89+
if ('once' in client) client.once('ready', () => {
8990
setTimeout(() => this.triggerReady(), 1500); // Allow main listener to be called first.
9091
});
9192
}

0 commit comments

Comments
 (0)