Options
All
  • Public
  • Public/Protected
  • All
Menu

Shard class, which provides a wrapper around the DiscordConnector with metadata like the id of the shard.

This class is automatically instantiated by the library and is documented for reference.

Hierarchy

Index

Constructors

  • Create a new Shard.

    Parameters

    • id: number

      id of the shard.

    • client: <internal>.Client

      Main class used for forwarding events.

    Returns Shard

Properties

connector: DiscordConnector
id: number
ready: boolean
default: typeof Shard
defaultMaxListeners: number

Accessors

  • get latency(): number
  • Time in ms it took for Discord to ackknowledge an OP 1 HEARTBEAT.

    Returns number

Methods

  • connect(): void
  • Create a new connection to Discord.

    Returns void

  • Close the current connection to Discord.

    Returns Promise<void>

  • getMaxListeners(): number
  • listeners(event: keyof ShardEvents): ((...args: any[]) => any)[]
  • prependListener<E>(event: E, listener: ((...args: ShardEvents[E]) => any)): Shard
  • prependOnceListener<E>(event: E, listener: ((...args: ShardEvents[E]) => any)): Shard
  • rawListeners(event: keyof ShardEvents): ((...args: any[]) => any)[]
  • removeListener<E>(event: E, listener: ((...args: ShardEvents[E]) => any)): Shard
  • setMaxListeners(n: number): Shard
  • Send an OP 4 VOICE_STATE_UPDATE to Discord.

    Parameters

    Returns Promise<void>

Generated using TypeDoc