class WebSocketManager

implements

AsyncDisposable
external
declare class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap> implements AsyncDisposable

Constructors

external
constructor()

Constructs a new instance of the WebSocketManager class

readonlyexternal
options : Omit<WebSocketManagerOptions, 'token'>

The options being used by this manager

readonlyexternal
token : string

Gets the token set for this manager. If no token is set, an error is thrown. To set the token, use setToken or pass it in the options.

external
[Symbol.asyncDispose]() : Promise<void>

external
connect() : Promise<void>

external
destroy(
options?: Omit<WebSocketShardDestroyOptions, 'recover'>
) : Promise<void>

Destroys all shards

external
fetchStatus() : Awaitable<Collection<number, WebSocketShardStatus>>

external
getGatewayInformation() : RESTGetAPIGatewayBotResult

The /gateway/bot information provided to connect. Throws if the method has not been invoked yet.

external
getShardCount() : number

Yields the total number of shards across for your bot, accounting for Discord recommendations

external
getShardIds() : number[]

Yields the ids of the shards this manager should manage

external
send(
shardId: number
) : Awaitable<void>

external
setToken(
token: string
) : void

external
updateShardCount(
shardCount: number | null
) : Promise<this>

Updates your total shard count on-the-fly, re-spawning all shards to the new amount