Interface Options<LibClientType, LibClientOptions, LibClientStatus, LibClient, LibLatencyRef>

Options for the sharding manager

Type Parameters

  • LibClientType

  • LibClientOptions

  • LibClientStatus

  • LibClient

  • LibLatencyRef

Hierarchy

  • Options

Properties

BotWorker?: typeof BaseClusterWorker

Your BotWorker class (must extend BaseClusterWorker)

broadcastAdmiralEvents?: boolean

Whether to broadcast Admiral events (e.g. when a cluster is ready) Note to avoid using Admiral event names when this is enabled

Default Value

true

clientOptions?: LibClientOptions

Options to pass to the Eris client constructor. Intents default to all non-privileged intents.

clusterTimeout?: number

How long between starting clusters

Default Value

5e3

clusters?: number | "auto"

Number of clusters

Default Value

"auto"

customClient?: LibClientType

Extended eris client class (should extend Eris.Client)

fetchTimeout?: number

How long to wait in ms before giving up on a fetch (includes eval functions and commands)

Default Value

10e3

firstShardID?: number

First shard ID to use on this instance of eris-fleet

guildsPerShard?: number | "auto"

Guilds per shard. "auto" uses the gateway's recommended shard count.

Default Value

"auto"

killTimeout?: number

Amount of time to wait in ms before doing a forced shutdown during shutdowns

Default Value

10e3

lastShardID?: number

Last shard ID to use on this instance of eris-fleet

lessLogging?: boolean

Option to have less logging show up

Default Value

false

loadCodeImmediately?: boolean

Whether to load your cluster class as soon as possible or wait until Eris's ready event. If you use this, your bot file must listen for the Eris ready event before doing anything which requires all shards to be connected. Also note that this will allow or your BotWorker to listen for events already being listened for in the old cluster during a soft restart. Be careful to avoid responding to an event twice.

Default Value

false

maxConcurrencyOverride?: number

Override the max_concurrency value sent from Discord (useful if using eris-fleet across machines). Set to 1 to disable concurrency.

maxRestarts?: number

Maximum amount of restarts of a worker before giving up. -1 is infinite.

Default Value

5

nodeArgs?: string[]

Node arguments to pass to the clusters

objectLogging?: boolean

Whether to split the source in to an Object

Default Value

false

See

ObjectLog See for the object which is given in the logging event if this option is enabled

overrideConsole?: boolean

Whether to override console.log, console.debug, console.warn, and console.error in clusters and services

Default Value

true

path?: string

Absolute path to the js file

serviceTimeout?: number

How long to wait for a service to start

Default Value

0

services?: ServiceCreator<LibLatencyRef>[]

Services to start by name and path

shards?: number | "auto"

Number of shards

Default Value

"auto"

shutdownTogether?: boolean

Whether to shutdown shutdown services and clusters together whenever possible

Default Value

false

softKillNotificationPeriod?: number

Amount of time (milliseconds) to wait before proceeding with a soft kill after the new cluster is ready. Set to 0 to disable (default)

Default Value

0

startServicesTogether?: boolean

Whether to start services together or not.

Default Value

false

startingStatus?: LibClientStatus

Custom starting status

statsInterval?: number | "disable"

How often to update the stats after all clusters are spawned (set to "disable" to disable automated stats)

Default Value

60e3

token: string

Bot token

useCentralRequestHandler?: boolean

Whether to use a central request handler. The central request handler routes Eris requests to the Discord API through a single instance of the Eris RequestHandler. This helps prevent 429 errors from the Discord API by using a single rate limiter pool.

Default Value

false

whatToLog?: {
    blacklist?: LoggingOptions[];
    whitelist?: LoggingOptions[];
}

Allows for more logging customization (overrides generic lessLogging option)

See

LoggingOptions See for available options

Example

const options = {
// Your other options
whatToLog: {
// This will only log when the admiral starts, when clusters are ready, and when services are ready.
whitelist: ['admiral_start', 'cluster_ready', 'service_ready']
}
};

Type declaration

Generated using TypeDoc