Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Shard

Hierarchy

  • EventEmitter
    • Shard

Index

Constructors

constructor

  • Parameters

    Returns Shard

Properties

client

client: Client

connecting

connecting: boolean

Optional discordServerTrace

discordServerTrace: undefined | string[]

id

id: number

lastHeartbeatReceived

lastHeartbeatReceived: number

lastHeartbeatSent

lastHeartbeatSent: number

latency

latency: number

on

presence

presence: Presence

ready

ready: boolean

status

status: "ready" | "disconnected" | "connecting" | "handshaking" | "resuming"

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): Shard
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Shard

connect

  • connect(): void
  • Returns void

disconnect

  • disconnect(options?: { reconnect: boolean }): void
  • Parameters

    • Optional options: { reconnect: boolean }
      • reconnect: boolean

    Returns void

editAFK

  • editAFK(afk: boolean): void
  • Parameters

    • afk: boolean

    Returns void

editStatus

  • Parameters

    Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): Shard
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Shard

once

  • once(event: string | symbol, listener: (...args: any[]) => void): Shard
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Shard

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): Shard
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Shard

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): Shard
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Shard

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): Shard
  • Parameters

    • Optional event: string | symbol

    Returns Shard

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): Shard
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Shard

sendWS

  • sendWS(op: number, _data: object, priority: boolean): void
  • Parameters

    • op: number
    • _data: object
    • priority: boolean

    Returns void

setMaxListeners

  • setMaxListeners(n: number): Shard
  • Parameters

    • n: number

    Returns Shard

toJSON

  • Parameters

    • Optional props: string[]

    Returns JSONCache

toString

  • toString(): string
  • Returns string

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc