You are reading the documentation for the next version of discord.js. Documentation for v13/v14+ has been moved to old.discordjs.dev

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
optionsPartial<OptionalWebSocketManagerOptions> & RequiredWebSocketManagerOptionsNoNone
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
fetchStatus():Awaitable<Collection<number, WebSocketShardStatus>>
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
updateShardCount(shardCount):Promise<this>
Updates your total shard count on-the-fly, spawning shards as needed
NameTypeOptionalDescription
shardCountnumber | nullNoThe new shard count to use