WebSocketShard

export class WebSocketShard extends EventEmitter
export class WebSocketShard extends EventEmitter
Represents a Shard's WebSocket connection

Extends

EventEmitter
allReady(unavailableGuilds)
Emitted when the shard is fully ready. This event is emitted if: all guilds were received by this shard the ready timeout expired, and some guilds are unavailable
NameTypeOptionalDescription
unavailableGuildsSet<string>NoSet of unavailable guilds, if any
close(event)
Emitted when a shard's WebSocket closes.
NameTypeOptionalDescription
eventCloseEventNoThe received event
ready()
Emitted when the shard receives the READY payload and is now waiting for guilds
resumed()
Emitted when the shard resumes successfully
id:number
The shard's id
lastPingTimestamp:number
The last time a ping was sent (a timestamp)
The WebSocketManager of the shard
ping:number
The previous heartbeat ping of the shard
status:Status
The current status of the shard
on(event, listener):this
NameTypeOptionalDescription
eventKNoNone
listener(...args: WebSocketShardEventTypes[K]) => Awaitable<void>NoNone
once(event, listener):this
NameTypeOptionalDescription
eventKNoNone
listener(...args: WebSocketShardEventTypes[K]) => Awaitable<void>NoNone
send(data, important?):void
Adds a packet to the queue to be sent to the gateway. If you use this method, make sure you understand that you need to provide a full [Payload](https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-commands). Do not use this method if you don't know what you're doing.
NameTypeOptionalDescription
dataunknownNoThe full packet to send
importantbooleanYesIf this packet should be added first in queue This parameter is **deprecated**. Important payloads are determined by their opcode instead.