WebSocketManager
declare class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap>
declare class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap>
No summary provided.
Extends
AsyncEventEmitter<ManagerShardEventsMap>constructor(options)
Constructs a new instance of the
WebSocketManager
className | Type | Optional | Description |
---|---|---|---|
options | Partial<OptionalWebSocketManagerOptions> & RequiredWebSocketManagerOptions | No | None |
Readonly
The options being used by this manager
connect()
:
Promise<void>
destroy(options?)
:
Awaitable<void>
Name | Type | Optional | Description |
---|---|---|---|
options | Omit<WebSocketShardDestroyOptions, 'recover'> | Yes | None |
fetchGatewayInformation(force?)
:
Promise<APIGatewayBotInfo>
Fetches the gateway information from Discord - or returns it from cache if available
Name | Type | Optional | Description |
---|---|---|---|
force | boolean | Yes | Whether to ignore the cache and force a fresh fetch |
getShardCount()
:
Promise<number>
Yields the total number of shards across for your bot, accounting for Discord recommendations
getShardIds(force?)
:
Promise<number[]>
Yields the ids of the shards this manager should manage
Name | Type | Optional | Description |
---|---|---|---|
force | boolean | Yes | None |
send(shardId, payload)
:
Awaitable<void>
Name | Type | Optional | Description |
---|---|---|---|
shardId | number | No | None |
payload | GatewaySendPayload | No | None |
setStrategy(strategy)
:
this
Name | Type | Optional | Description |
---|---|---|---|
strategy | IShardingStrategy | No | None |
updateShardCount(shardCount)
:
Promise<this>
Updates your total shard count on-the-fly, spawning shards as needed
Name | Type | Optional | Description |
---|---|---|---|
shardCount | number | null | No | The new shard count to use |