GatewayOptions
Defined in: packages/ws/src/index.ts:85
Gateway connection configuration.
Properties
Section titled âPropertiesâcompress?
Section titled âcompress?â
optionalcompress?:boolean
Defined in: packages/ws/src/index.ts:122
Whether to enable zlib-stream transport compression.
Decoded with a persistent node:zlib inflate stream, matching
Discordâs zlib-wrapped stream framing (Z_SYNC_FLUSH boundaries).
When enabled, appends &compress=zlib-stream to the Gateway URL.
connectTimeout?
Section titled âconnectTimeout?â
optionalconnectTimeout?:number
Defined in: packages/ws/src/index.ts:99
How long a socket may stay connecting before it is closed and retried, in ms. Default 30000.
createSocket?
Section titled âcreateSocket?â
optionalcreateSocket?:SocketFactory
Defined in: packages/ws/src/index.ts:127
Constructs the underlying socket. Defaults to the ambient WebSocket.
Injected to run the Gateway on an alternative transport, or on a stub.
heartbeatAckTimeout?
Section titled âheartbeatAckTimeout?â
optionalheartbeatAckTimeout?:number
Defined in: packages/ws/src/index.ts:105
Heartbeat acknowledgement timeout.
intents
Section titled âintentsâintents:
GatewayIntentResolvable
Defined in: packages/ws/src/index.ts:89
Gateway intent bitfield or resolvable.
maxReconnectAttempts?
Section titled âmaxReconnectAttempts?â
optionalmaxReconnectAttempts?:number
Defined in: packages/ws/src/index.ts:97
Maximum reconnect attempts.
presence?
Section titled âpresence?â
optionalpresence?:GatewayPresence
Defined in: packages/ws/src/index.ts:115
Presence data.
properties?
Section titled âproperties?â
optionalproperties?:GatewayProperties
Defined in: packages/ws/src/index.ts:113
Identification properties.
reconnect?
Section titled âreconnect?â
optionalreconnect?:boolean
Defined in: packages/ws/src/index.ts:95
Whether automatic reconnect is enabled.
reconnectBaseDelay?
Section titled âreconnectBaseDelay?â
optionalreconnectBaseDelay?:number
Defined in: packages/ws/src/index.ts:101
Initial reconnect delay.
reconnectMaxDelay?
Section titled âreconnectMaxDelay?â
optionalreconnectMaxDelay?:number
Defined in: packages/ws/src/index.ts:103
Maximum reconnect delay.
reconnectStormLimit?
Section titled âreconnectStormLimit?â
optionalreconnectStormLimit?:number
Defined in: packages/ws/src/index.ts:109
Reconnects inside reconnectStormWindow after which the link counts as unstable: unstable is emitted and the delay keeps doubling. Default 5.
reconnectStormWindow?
Section titled âreconnectStormWindow?â
optionalreconnectStormWindow?:number
Defined in: packages/ws/src/index.ts:111
The span over which reconnects are counted for storm detection, in ms. Default 60,000.
shardCount?
Section titled âshardCount?â
optionalshardCount?:number
Defined in: packages/ws/src/index.ts:93
Total shard count.
shardId?
Section titled âshardId?â
optionalshardId?:number
Defined in: packages/ws/src/index.ts:91
Shard identifier.
token:
string
Defined in: packages/ws/src/index.ts:87
Authentication token.
zombieTimeout?
Section titled âzombieTimeout?â
optionalzombieTimeout?:number
Defined in: packages/ws/src/index.ts:107
Zombie connection timeout.