OptionalWebSocketManagerOptions

export interface OptionalWebSocketManagerOptions
export interface OptionalWebSocketManagerOptions
Optional additional configuration for the WebSocketManager
compression:CompressionMethod | null
The compression method to use null (no compression)
encoding:Encoding
The encoding to use 'json'
handshakeTimeout:number | null
How long to wait for a shard to connect before giving up
helloTimeout:number | null
How long to wait for a shard's HELLO packet before giving up
identifyProperties:GatewayIdentifyProperties
Properties to send to the gateway when identifying
initialPresence:GatewayPresenceUpdateData | null
Initial presence data to send to the gateway when identifying
largeThreshold:number | null
Value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list
readyTimeout:number | null
How long to wait for a shard's READY packet before giving up
retrieveSessionInfo:(shardId: number) => Awaitable<SessionInfo | null>
Function used to retrieve session information (and attempt to resume) for a given shard
Example
const manager = new WebSocketManager( async retrieveSessionInfo(shardId): AwaitableSessionInfo | null // Fetch this info from redis or similar return sessionId: string, sequence: number ; // Return null if no information is found , );
shardCount:number | null
The total number of shards across all WebsocketManagers you intend to instantiate. Use null to use Discord's recommended shard count
shardIds:number[] | ShardRange | null
The ids of the shards this WebSocketManager should manage. Use null to simply spawn 0 through shardCount - 1
Example
const manager = new WebSocketManager( shardIds: [1, 3, 7], // spawns shard 1, 3, and 7, nothing else );
Example
const manager = new WebSocketManager( shardIds: start: 3, end: 6, , // spawns shards 3, 4, 5, and 6 );
updateSessionInfo:(shardId: number, sessionInfo: SessionInfo | null) => Awaitable<void>
Function used to store session information for a given shard
version:string
The gateway version to use '10'