Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BotSocketShard

Connects every bot shard to a {@link WebSocket} with the Discord Gateway. Handles gateway events and messages

Hierarchy

  • BotSocketShard

Index

Constructors

constructor

Properties

pendingGuilds

pendingGuilds: Set<Snowflake>

All guilds pending to be cached from the gateway READY event

sequence

sequence: number | null

The sequence number of this shard

sessionId

sessionId: string

The session ID of this shard

Readonly shard

Holds shard details

state

This shard's state

ws

ws: WebSocket

The WebSocket connection associated to this shard

Methods

close

configure

  • configure(): void

connect

  • connect(resume?: boolean): Promise<void>
  • Connects to the Discord Gateway and resumes a previous connection if needed

    Parameters

    • Default value resume: boolean = false

      Whether to resume a previous connection

    Returns Promise<void>

pack

  • pack(data: unknown): Buffer | string | undefined
  • Transfers the data into format which can be sent across the gateway

    Parameters

    • data: unknown

      Data to be transferred and sent to the gateway

    Returns Buffer | string | undefined

ready

  • ready(): void

send

  • send(data: unknown): void

Generated using TypeDoc