ShardedGatewayForwarderPlugin
The base class for all plugins
Extends
Constructors
Constructor
new ShardedGatewayForwarderPlugin(
options
):ShardedGatewayForwarderPlugin
Parameters
Parameter | Type |
---|---|
options | ShardedGatewayForwarderPluginOptions |
Returns
ShardedGatewayForwarderPlugin
Overrides
Properties
Property | Modifier | Type | Default value | Description | Overrides | Inherited from |
---|---|---|---|---|---|---|
client? | protected | Client | undefined | - | - | ShardingPlugin .client |
config | readonly | ShardingPluginOptions | undefined | - | - | ShardingPlugin .config |
customGatewayPlugin | public | typeof GatewayForwarderPlugin | GatewayForwarderPlugin | - | ShardingPlugin .customGatewayPlugin | - |
gatewayInfo? | protected | APIGatewayBotInfo | undefined | - | - | ShardingPlugin .gatewayInfo |
id | readonly | "sharding" | "sharding" | An ID that identifies the plugin uniquely between all other used plugins in the Client | - | ShardingPlugin .id |
maxConcurrency | protected | number | undefined | - | - | ShardingPlugin .maxConcurrency |
shards | readonly | Map <number , GatewayPlugin > | undefined | - | - | ShardingPlugin .shards |
spawning | protected | boolean | false | - | - | ShardingPlugin .spawning |
spawnQueue | protected | number [] | [] | - | - | ShardingPlugin .spawnQueue |
Methods
calculateShardId()
protected
calculateShardId(guildId
,totalShards
):number
Discord's sharding formula
Parameters
Parameter | Type |
---|---|
guildId | string |
totalShards | number |
Returns
number
Inherited from
ShardingPlugin
.calculateShardId
disconnect()
disconnect():
void
Returns
void
Inherited from
getShardForGuild()
getShardForGuild(
guildId
):undefined
|GatewayPlugin
Calculate which shard a guild belongs to
Parameters
Parameter | Type |
---|---|
guildId | string |
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
Parameter | Type | Description |
---|---|---|
client | Client | The client to register |
Returns
Promise
<void
>
Inherited from
registerRoutes()?
optional
registerRoutes(client
):void
|Promise
<void
>
Registers the routes of this plugin with the client
Parameters
Parameter | Type | Description |
---|---|---|
client | Client | The client to register the routes with |
Returns
void
| Promise
<void
>