Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VoiceConnection

Hierarchy

  • EventEmitter
    • VoiceConnection

Implements

Index

Constructors

constructor

  • new VoiceConnection(id: string, options?: { opusOnly?: undefined | boolean; shard?: undefined | Shard; shared?: undefined | boolean }): VoiceConnection
  • Parameters

    • id: string
    • Optional options: { opusOnly?: undefined | boolean; shard?: undefined | Shard; shared?: undefined | boolean }
      • Optional opusOnly?: undefined | boolean
      • Optional shard?: undefined | Shard
      • Optional shared?: undefined | boolean

    Returns VoiceConnection

Properties

channelID

channelID: string

connecting

connecting: boolean

Optional current

current: undefined | { options: VoiceResourceOptions; pausedTime?: undefined | number; pausedTimestamp?: undefined | number; playTime: number; startTime: number }

id

id: string

paused

paused: boolean

playing

playing: boolean

ready

ready: boolean

volume

volume: number

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns VoiceConnection

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): VoiceConnection
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns VoiceConnection

on

  • on(event: "warn" | "debug", listener: (message: string) => void): VoiceConnection
  • on(event: "disconnect" | "error", listener: (err: Error) => void): VoiceConnection
  • on(event: "pong", listener: (latency: number) => void): VoiceConnection
  • on(event: "speakingStart", listener: (userID: string) => void): VoiceConnection
  • on(event: "speakingStop", listener: (userID: string) => void): VoiceConnection
  • on(event: "end", listener: () => void): VoiceConnection
  • on(event: "userDisconnect", listener: (userID: string) => void): VoiceConnection
  • Parameters

    • event: "warn" | "debug"
    • listener: (message: string) => void
        • (message: string): void
        • Parameters

          • message: string

          Returns void

    Returns VoiceConnection

  • Parameters

    • event: "disconnect" | "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns VoiceConnection

  • Parameters

    • event: "pong"
    • listener: (latency: number) => void
        • (latency: number): void
        • Parameters

          • latency: number

          Returns void

    Returns VoiceConnection

  • Parameters

    • event: "speakingStart"
    • listener: (userID: string) => void
        • (userID: string): void
        • Parameters

          • userID: string

          Returns void

    Returns VoiceConnection

  • Parameters

    • event: "speakingStop"
    • listener: (userID: string) => void
        • (userID: string): void
        • Parameters

          • userID: string

          Returns void

    Returns VoiceConnection

  • Parameters

    • event: "end"
    • listener: () => void
        • (): void
        • Returns void

    Returns VoiceConnection

  • Parameters

    • event: "userDisconnect"
    • listener: (userID: string) => void
        • (userID: string): void
        • Parameters

          • userID: string

          Returns void

    Returns VoiceConnection

once

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

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

          • Rest ...args: any[]

          Returns void

    Returns VoiceConnection

pause

  • pause(): void
  • Returns void

play

  • Parameters

    Returns void

prependListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns VoiceConnection

prependOnceListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns VoiceConnection

rawListeners

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

    • event: string | symbol

    Returns Function[]

receive

  • Parameters

    • type: string

    Returns VoiceDataStream

removeAllListeners

  • Parameters

    • Optional event: string | symbol

    Returns VoiceConnection

removeListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns VoiceConnection

resume

  • resume(): void
  • Returns void

setMaxListeners

  • Parameters

    • n: number

    Returns VoiceConnection

setVolume

  • setVolume(volume: number): void
  • Parameters

    • volume: number

    Returns void

stopPlaying

  • stopPlaying(): void
  • Returns void

switchChannel

  • switchChannel(channelID: string): void
  • Parameters

    • channelID: string

    Returns void

toJSON

  • Parameters

    • Optional props: string[]

    Returns JSONCache

toString

  • toString(): string
  • Returns string

updateVoiceState

  • updateVoiceState(selfMute: boolean, selfDeaf: boolean): void
  • Parameters

    • selfMute: boolean
    • selfDeaf: boolean

    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