Options
All
  • Public
  • Public/Protected
  • All
Menu

Wrapper for Discord's VoiceConnection that keeps track of activity so you can customize things to do when inactive (usually for auto-disconnecting).

Hierarchy

  • ActivityTrackingVoiceConnection

Accessors

connection

  • get connection(): VoiceConnection

Gets the underlying Discord VoiceConnection.

  • This shouldn't be needed most of the time, but if you know what you're doing, go for it.
  • (WARNING) Does not track voice activity so may disconnect mid action even when using this.

Returns VoiceConnection

Underlying VoiceConnection

lastActivity

  • get lastActivity(): Moment

Gets the last activity detected on this connection. Returns now if currently active

Returns Moment

Moment of last activity, is now if currently active.

Methods

disconnect

  • disconnect(): void

Disconnect from the voice channel and cleans up underlying connection and wrapper.

!(DANGER) Do not continue using this after disconnect.

Returns void

on

  • on(event: string, listener: function): VoiceConnection

Parameters

  • event: string
  • listener: function
      • (...args: Array<any>): void
      • Parameters

        • ...args: Array<any> Rest

        Returns void

Returns VoiceConnection

once

  • once(event: string, listener: function): VoiceConnection

Parameters

  • event: string
  • listener: function
      • (...args: Array<any>): void
      • Parameters

        • ...args: Array<any> Rest

        Returns void

Returns VoiceConnection

play

  • play(input: VoiceBroadcast | Readable | string, options?: StreamOptions): StreamDispatcher

Parameters

  • input: VoiceBroadcast | Readable | string
  • options: StreamOptions Optional

Returns StreamDispatcher

setSpeaking

  • setSpeaking(value: BitFieldResolvable<SpeakingString>): void

Parameters

  • value: BitFieldResolvable<SpeakingString>

Returns void

whenInactiveForDuration

Subscribe to when inactivity reaches provided time threshold.

![WARNING] For simplicity's sake, only 1 listener can exist, so if this method is called more than once, an error will throw. ![WARNING] This may change in the future.

Parameters

Returns this

Static wrapConnection

Wraps a VoiceConnection in voice activity tracking logic.

Parameters

Returns ActivityTrackingVoiceConnection

ActivityTrackingVoiceConnection wrapping the provided connection.

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.