export class WebSocketShard extends EventEmitter
Represents a Shard's WebSocket connection
number id :
The shard's id
number lastPingTimestamp :
The last time a ping was sent (a timestamp)
WebSocketManager manager :
The WebSocketManager of the shard
number ping :
The previous heartbeat ping of the shard
Status status :
The current status of the shard
deprecated emitCloseevent?: CloseEvent) : (
yes
This method is responsible to emit close event for this shard. This method helps the shard reconnect.
onEvent extends keyof WebSocketShardEventTypes
>(event: Eventlistener: (...args: WebSocketShardEventTypes[Event]) => void) : this <
Event extends keyof WebSocketShardEventTypes
onceEvent extends keyof WebSocketShardEventTypes
>(event: Eventlistener: (...args: WebSocketShardEventTypes[Event]) => void) : this <
Event extends keyof WebSocketShardEventTypes
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.
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
closeevent: CloseEvent) (
Emitted when a shard's WebSocket closes.