Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Shard

Hierarchy

  • EventEmitter
    • Shard

Implements

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

checkReady

  • checkReady(): void
  • Returns void

connect

  • connect(): void
  • Returns void

createGuild

  • Parameters

    Returns Guild

disconnect

  • disconnect(options?: { reconnect?: undefined | boolean | "auto" }, error?: Error): void
  • Parameters

    • Optional options: { reconnect?: undefined | boolean | "auto" }
      • Optional reconnect?: undefined | boolean | "auto"
    • Optional error: Error

    Returns void

editAFK

  • editAFK(afk: boolean): void
  • Parameters

    • afk: boolean

    Returns void

editStatus

emit

  • emit(event: string, ...args: any[]): void
  • Parameters

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

    Returns void

eventNames

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

getGuildMembers

  • getGuildMembers(guildID: string, timeout: number): void
  • Parameters

    • guildID: string
    • timeout: number

    Returns void

getMaxListeners

  • getMaxListeners(): number
  • Returns number

hardReset

  • hardReset(): void
  • Returns void

heartbeat

  • heartbeat(normal?: boolean): void
  • Parameters

    • Optional normal: boolean

    Returns void

identify

  • identify(): void
  • Returns void

initializeWS

  • initializeWS(): void
  • Returns void

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

onPacket

  • Parameters

    Returns void

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

requestGuildMembers

requestGuildSync

  • requestGuildSync(guildID: string): void
  • Parameters

    • guildID: string

    Returns void

reset

  • reset(): void
  • Returns void

restartGuildCreateTimeout

  • restartGuildCreateTimeout(): void
  • Returns void

resume

  • resume(): void
  • Returns void

sendStatusUpdate

  • sendStatusUpdate(): void
  • Returns void

sendWS

  • sendWS(op: number, _data: Record<string, unknown>, priority?: boolean): void
  • Parameters

    • op: number
    • _data: Record<string, unknown>
    • Optional priority: boolean

    Returns void

setMaxListeners

  • setMaxListeners(n: number): Shard
  • Parameters

    • n: number

    Returns Shard

syncGuild

  • syncGuild(guildID: string): void
  • Parameters

    • guildID: string

    Returns void

toJSON

  • Parameters

    • Optional props: string[]

    Returns JSONCache

wsEvent

  • Parameters

    Returns void

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