Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VoiceConnection

Voice Connection

Hierarchy

  • EventSpewer
    • VoiceConnection

Implements

  • EventEmitter

Index

Constructors

constructor

Properties

client

client: ShardClient

decodeAudio

decodeAudio: boolean

formats

formats: object

Type declaration

gateway

gateway: Socket

handler

handler: MediaHandler

opusDecoder

opusDecoder: null | OpusDecoderSettings

opusDecoders

opusDecoders: BaseCollection<string, AudioOpus>

opusEncoder

opusEncoder: null | AudioOpus

Accessors

channel

  • Returns Channel | null

channelId

  • get channelId(): string
  • Returns string

guild

  • get guild(): Guild | null
  • Returns Guild | null

guildId

  • get guildId(): null | string
  • Returns null | string

killed

  • get killed(): boolean
  • Returns boolean

member

  • Returns Member | null

serverId

  • get serverId(): string
  • Returns string

user

  • get user(): null | User
  • Returns null | User

userId

  • get userId(): string
  • Returns string

voiceState

  • Returns null | VoiceState

Methods

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

decode

  • decode(userId: string, data: Buffer, options?: DecodeSettings): Buffer
  • Parameters

    • userId: string
    • data: Buffer
    • Default value options: DecodeSettings = {}

    Returns Buffer

emit

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

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

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

fetchOpusDecoder

  • fetchOpusDecoder(userId: string): AudioOpus
  • Parameters

    • userId: string

    Returns AudioOpus

getMaxListeners

  • getMaxListeners(): number
  • Returns number

hasEventListener

  • hasEventListener(name: string | symbol): boolean
  • Parameters

    • name: string | symbol

    Returns boolean

kill

  • kill(): 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: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: function): this
  • on(event: "connect", listener: function): this
  • on(event: "disconnect", listener: function): this
  • on(event: "speaking", listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "connect"
    • listener: function
        • (payload: any): any
        • Parameters

          • payload: any

          Returns any

    Returns this

  • Parameters

    • event: "disconnect"
    • listener: function
        • (payload: any): any
        • Parameters

          • payload: any

          Returns any

    Returns this

  • Parameters

    • event: "speaking"
    • listener: function
        • (payload: any): any
        • Parameters

          • payload: any

          Returns any

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(name?: string | symbol): this
  • Parameters

    • Optional name: string | symbol

    Returns this

removeAllSubscriptions

  • removeAllSubscriptions(): this
  • Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

removeSubscription

  • removeSubscription(subscription: EventSubscription): void
  • Parameters

    • subscription: EventSubscription

    Returns void

sendAudio

  • Parameters

    Returns void

sendAudioSilenceFrame

  • sendAudioSilenceFrame(): void
  • Returns void

setDeaf

  • setDeaf(selfDeaf: boolean): Promise<void>
  • Parameters

    • selfDeaf: boolean

    Returns Promise<void>

setDecodeAudio

  • setDecodeAudio(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setMute

  • setMute(selfMute: boolean): Promise<void>
  • Parameters

    • selfMute: boolean

    Returns Promise<void>

setOpusDecoder

  • setOpusDecoder(options?: boolean | OpusOptions): void
  • Parameters

    Returns void

setOpusEncoder

  • setOpusEncoder(options?: boolean | OpusOptions): void
  • Parameters

    Returns void

setSpeaking

  • setSpeaking(options: object): Promise<void>
  • Parameters

    • options: object
      • Optional delay?: undefined | number
      • Optional soundshare?: undefined | false | true
      • Optional ssrc?: undefined | number
      • Optional voice?: undefined | false | true

    Returns Promise<void>

setState

  • setState(options: object): Promise<void>
  • Parameters

    • options: object
      • Optional selfDeaf?: undefined | false | true
      • Optional selfMute?: undefined | false | true
      • Optional selfVideo?: undefined | false | true

    Returns Promise<void>

setVideo

  • setVideo(selfVideo: boolean): Promise<void>
  • Parameters

    • selfVideo: boolean

    Returns Promise<void>

subscribe

  • subscribe(name: string | symbol, listener: function): EventSubscription
  • Parameters

    • name: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventSubscription

Generated using TypeDoc