|
1 | 1 | import { ClusterClientEvents, EvalOptions, MessageTypes, Serialized, Awaitable, ValidIfSerializable, SerializableInput, ClusterClientData } from '../types';
|
2 | 2 | import { BaseMessage, BaseMessageInput, DataType, ProcessMessage } from '../other/message';
|
3 | 3 | import { BrokerMessage, IPCBrokerClient } from '../handlers/broker';
|
| 4 | +import { ShardingClient, ShardingClientSapphire } from './client'; |
4 | 5 | import { ClusterClientHandler } from '../handlers/message';
|
5 | 6 | import { ShardingUtils } from '../other/shardingUtils';
|
6 | 7 | import { RefClusterManager } from './clusterManager';
|
7 | 8 | import { PromiseHandler } from '../handlers/promise';
|
8 | 9 | import { WorkerClient } from '../classes/worker';
|
9 | 10 | import { ChildClient } from '../classes/child';
|
10 | 11 | import { Serializable } from 'child_process';
|
11 |
| -import { ShardingClient } from './client'; |
12 | 12 | import { getInfo } from '../other/data';
|
13 | 13 | import { Guild } from 'discord.js';
|
14 | 14 | import EventEmitter from 'events';
|
15 | 15 |
|
16 |
| -export type RefShardingClient = ShardingClient; |
| 16 | +export type RefShardingClient = ShardingClient | ShardingClientSapphire; |
17 | 17 |
|
18 | 18 | /**
|
19 | 19 | * Simplified Cluster instance available on the {@link ClusterClient}.
|
@@ -85,7 +85,8 @@ export class ClusterClient<
|
85 | 85 | this.process.ipc.on('message', this._handleMessage.bind(this));
|
86 | 86 | this.promise = new PromiseHandler(this);
|
87 | 87 |
|
88 |
| - if (client?.once) client.once('ready', () => { |
| 88 | + // @ts-ignore |
| 89 | + if ('once' in client) client.once('ready', () => { |
89 | 90 | setTimeout(() => this.triggerReady(), 1500); // Allow main listener to be called first.
|
90 | 91 | });
|
91 | 92 | }
|
|
0 commit comments