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 | VoiceStreamCurrent

id

id: string

on

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

connect

  • Parameters

    Returns void | Timer

disconnect

  • disconnect(error?: Error, reconnecting?: boolean): void
  • Parameters

    • Optional error: Error
    • Optional reconnecting: boolean

    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

heartbeat

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

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

          • Rest ...args: any[]

          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: "opus" | "pcm"

    Returns VoiceDataStream

registerReceiveEventHandler

  • registerReceiveEventHandler(): void
  • Returns void

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

sendWS

  • sendWS(op: number, data: Record<string, unknown>): void
  • Parameters

    • op: number
    • data: Record<string, unknown>

    Returns void

setMaxListeners

  • Parameters

    • n: number

    Returns VoiceConnection

setSpeaking

  • setSpeaking(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

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

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