import Shard = require("./Shard"); import { Bucket } from "snowtransfer"; import { IShardResumeData } from "./Types"; /** * Class used for managing shards for the user. * * This class is automatically instantiated by the library and is documented for reference. * @since 0.1.4 */ declare class ShardManager { client: import("./Client"); /** The options used by the client */ options: ShardManager["client"]["options"]; /** A Record of shards keyed by their ID */ shards: Record; /** The bucket used to identify a certain number of shards within a day. */ identifyBucket: Bucket; /** The buckets used to identify x number of shards within 5 second intervals. Larger bots benefit from this, but doesn't change how many times per day any shards can identify. */ concurrencyBuckets: Record; /** * Create a new ShardManager. */ constructor(client: import("./Client")); /** * Create shard instances and add them to the connection queue. * @since 0.1.4 */ spawn(): void; /** * Disconnect all shards facilitated by this manager. * @since 0.1.4 * @param resumable Whether to close with a code that keeps the sessions alive for a later resume. See DiscordConnector.disconnect. */ disconnect(resumable?: boolean): void; /** * Collect the resume data of every shard that has a session to resume, keyed by shard id. * @since 0.19.0 */ getResumeData(): Record; /** * Add event listeners to a shard to that the manager can act on received events. * @since 0.1.4 * @param shard Shard to add the event listeners to. */ private _addListener; /** * Checks if all shards spawned by this manager are ready. * @since 0.1.4 */ private _checkReady; /** * Checks if all shards spawned by this manager are disconnected. * @since 0.1.4 */ private _checkDisconnect; /** * Look up a shard by id, ensure it can send, and run an action with it. * @since 0.19.0 * @param shardId id of the shard. * @param action What to do with the shard. */ private _withReadyShard; /** * Update the status of all currently connected shards which have been spawned by this manager. * @since 0.3.0 * @param data Data to send. */ presenceUpdate(data: Parameters["0"]): Promise; /** * Update the status of a single connected shard which has been spawned by this manager. * @since 0.3.0 * @param shardId id of the shard. * @param data Data to send. */ shardPresenceUpdate(shardId: number, data: Parameters["0"]): Promise; /** * Send an OP 4 VOICE_STATE_UPDATE with a certain shard. * @since 0.1.4 * @param shardId id of the shard. * @param data Data to send. */ voiceStateUpdate(shardId: number, data: Parameters["0"]): Promise; /** * Send an OP 8 REQUEST_GUILD_MEMBERS with a certain shard. * @since 0.1.4 * @param shardId id of the shard. * @param data Data to send. */ requestGuildMembers(shardId: number, data: Parameters["0"]): Promise; /** * Send an OP 31 REQUEST_SOUNDBOARD_SOUNDS with a certain shard. * @since 0.19.0 * @param shardId id of the shard. * @param guilds The guilds to get the soundboard sounds from. */ requestSoundboardSounds(shardId: number, guilds: Parameters["0"]): Promise; /** * Send an OP 43 REQUEST_CHANNEL_INFO with a certain shard. * @since 0.19.0 * @param shardId id of the shard. * @param data Data to send. */ requestChannelInfo(shardId: number, data: Parameters["0"]): Promise; } export = ShardManager;