Interface ShardManagerInstanceOptions

interface ShardManagerInstanceOptions {
    autoReconnect: boolean;
    compress: boolean;
    concurrency: number;
    connectionProperties: Required<undefined | {
        browser?: string;
        device?: string;
        os?: string;
    }>;
    connectionTimeout: number;
    firstShardID: number;
    getAllUsers: boolean;
    guildCreateTimeout: number;
    intents: number;
    largeThreshold: number;
    lastShardID: number;
    lookupDisallowedIntents: boolean;
    maxReconnectAttempts: number;
    maxResumeAttempts: number;
    maxShards: number;
    override: Omit<OverrideOptions, "appendQuery" | "gatewayURLIsResumeURL" | "timeBetweenShardConnects"> & Required<Pick<OverrideOptions, "appendQuery" | "gatewayURLIsResumeURL" | "timeBetweenShardConnects">>;
    presence: Required<UpdatePresenceOptions>;
    reconnectDelay: ReconnectDelayFunction;
    removeDisallowedIntents: boolean;
    seedVoiceConnections: boolean;
    shardIDs: number[];
    ws: ClientOptions;
}

Hierarchy

  • Required<Omit<GatewayOptions, "concurrency" | "connectionProperties" | "intents" | "maxShards" | "presence" | "override">>
    • ShardManagerInstanceOptions

Properties

autoReconnect: boolean

If dropped connections should be automatically reconnected.

Default Value

true
compress: boolean

If packets to and from Discord should be compressed.

Default Value

false
concurrency: number
connectionProperties: Required<undefined | {
    browser?: string;
    device?: string;
    os?: string;
}>
connectionTimeout: number

The maximum amount of time in milliseconds to wait for a connection to be established.

Default Value

30000
firstShardID: number

The ID of the first shard to run for this client. Mutually exclusive with shardIDs.

Default Value

0
getAllUsers: boolean

If the members of all guilds should be requested. Requires the GUILD_MEMBERS intent.

Default Value

false
guildCreateTimeout: number

The time in milliseconds after which the client will consider all guilds to have been received.

Default Value

2000
intents: number
largeThreshold: number

The threshold at which guilds are considered "large" (after which offline members will not be loaded).

Default Value

250
lastShardID: number

The ID of the last shard to run for this client. Mutually exclusive with shardIDs.

Default Value

maxShards - 1
lookupDisallowedIntents: boolean

If upon recieving a disconnect for disallowed intents, we should request the application's flags and list the privileged intents that are missing in the error. This requires making a request to /applications/@me.

Default Value

false
maxReconnectAttempts: number

The maximum number of attempts to reconnect.

Default Value

Infinity
maxResumeAttempts: number

The maximum number of attempts to resume a lost connection.

Default Value

10
maxShards: number
override: Omit<OverrideOptions, "appendQuery" | "gatewayURLIsResumeURL" | "timeBetweenShardConnects"> & Required<Pick<OverrideOptions, "appendQuery" | "gatewayURLIsResumeURL" | "timeBetweenShardConnects">>
reconnectDelay: ReconnectDelayFunction

A function to calculate the delay between reconnect attempts.

Default Value

(lastDelay, attempts) => Math.pow(attempts + 1, 0.7) * 20000
removeDisallowedIntents: boolean

If a check should be made before connecting, which will remove any disallowed intents. This requires making a request to /applications/@me. Any removed intents will be emitted via the warn event.

Default Value

false
seedVoiceConnections: boolean

If existing voice connections should be populated. This will disconnect connections from other sessions.

Default Value

false
shardIDs: number[]

An array of shard IDs to run for this client. Mutually exclusive with firstShardID & lastShardID.

Default Value

based on firstShardID & lastShardID

ws: ClientOptions

The options to pass to constructed websockets.