Carbon
Plugins/gateway forwarder/Classes

ShardedGatewayForwarderPlugin

The base class for all plugins

Extends

Constructors

Constructor

new ShardedGatewayForwarderPlugin(options): ShardedGatewayForwarderPlugin

Parameters

Returns

ShardedGatewayForwarderPlugin

Overrides

ShardingPlugin.constructor

Properties

PropertyModifierTypeDefault valueDescriptionOverridesInherited from
client?protectedClientundefined--ShardingPlugin.client
configreadonlyShardingPluginOptionsundefined--ShardingPlugin.config
customGatewayPluginpublictypeof GatewayForwarderPluginGatewayForwarderPlugin-ShardingPlugin.customGatewayPlugin-
gatewayInfo?protectedAPIGatewayBotInfoundefined--ShardingPlugin.gatewayInfo
idreadonly"sharding""sharding"An ID that identifies the plugin uniquely between all other used plugins in the Client-ShardingPlugin.id
maxConcurrencyprotectednumberundefined--ShardingPlugin.maxConcurrency
shardsreadonlyMap<number, GatewayPlugin>undefined--ShardingPlugin.shards
spawningprotectedbooleanfalse--ShardingPlugin.spawning
spawnQueueprotectednumber[][]--ShardingPlugin.spawnQueue

Methods

calculateShardId()

protected calculateShardId(guildId, totalShards): number

Discord's sharding formula

Parameters

ParameterType
guildIdstring
totalShardsnumber

Returns

number

Inherited from

ShardingPlugin.calculateShardId


disconnect()

disconnect(): void

Returns

void

Inherited from

ShardingPlugin.disconnect


getShardForGuild()

getShardForGuild(guildId): undefined | GatewayPlugin

Calculate which shard a guild belongs to

Parameters

ParameterType
guildIdstring

Returns

undefined | GatewayPlugin

Inherited from

ShardingPlugin.getShardForGuild


processSpawnQueue()

protected processSpawnQueue(): Promise<void>

Returns

Promise<void>

Inherited from

ShardingPlugin.processSpawnQueue


registerClient()

registerClient(client): Promise<void>

Registers the client with this plugin

Parameters

ParameterTypeDescription
clientClientThe client to register

Returns

Promise<void>

Inherited from

ShardingPlugin.registerClient


registerRoutes()?

optional registerRoutes(client): void | Promise<void>

Registers the routes of this plugin with the client

Parameters

ParameterTypeDescription
clientClientThe client to register the routes with

Returns

void | Promise<void>

Inherited from

ShardingPlugin.registerRoutes

On this page