Search...

WebSocketManager

export declare class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap> 
export declare class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap> 

No summary provided.

Extends

AsyncEventEmitter<ManagerShardEventsMap

constructor(options)

Constructs a new instance of the WebSocketManager class
NameTypeOptionalDescription
optionsRequiredWebSocketManagerOptions & Partial<OptionalWebSocketManagerOptions>NoNone
Readonly
The options being used by this manager

connect()

:

Promise<void>

destroy(options?)

:

Awaitable<void>

NameTypeOptionalDescription
optionsOmit<WebSocketShardDestroyOptions, 'recover'>YesNone

fetchGatewayInformation(force?)

:

Promise<APIGatewayBotInfo>

Fetches the gateway information from Discord - or returns it from cache if available
NameTypeOptionalDescription
forcebooleanYesWhether 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
NameTypeOptionalDescription
forcebooleanYesNone

send(shardId, payload)

:

Awaitable<void>

NameTypeOptionalDescription
shardIdnumberNoNone
payloadGatewaySendPayloadNoNone

setStrategy(strategy)

:

this

NameTypeOptionalDescription
strategyIShardingStrategyNoNone

updateShardCount(shardCount)

:

Promise<this>

Updates your total shard count on-the-fly, spawning shards as needed
NameTypeOptionalDescription
shardCountnumber | nullNoThe new shard count to use