Options
All
  • Public
  • Public/Protected
  • All
Menu

Manages mapping guild to it's respective voice connection.

Singleton.

Hierarchy

  • VoiceConnectionService

Constructors

constructor

Returns VoiceConnectionService

Properties

Static Readonly DisconnectAfterInactiveForDuration

DisconnectAfterInactiveForDuration: Duration = Duration.fromMinutes(5)

How long before the service closes the connection.

Methods

disconnect

  • disconnect(guildId: string): void

Disconnect from voice in guild, if currently in a channel.

Parameters

  • guildId: string

    Guild id of which guild to disconnect from if in a voice channel.

Returns void

getConnectionForGuild

Gets an existing voice connection.

  • Prefer using getOrCreateConnectionForGuild unless you want this to fail
  • on attempt potentially, or if you know the connection exists.

Parameters

  • guildId: string

    Guild id to lookup voice connection for.

Returns ActivityTrackingVoiceConnection

getOrCreateConnectionForGuild

Gets or creates an existing voice channel.

Will disconnect if inactive for DisconnectAfterInactiveForDuration seconds.

Parameters

  • guildId: string

    Guild id to lookup voice connection for.

  • channelToUseIfNotInExisting: VoiceChannel

    Channel to join if connection does not exist.

Returns Promise<ActivityTrackingVoiceConnection>

subscribeToDisconnect

  • subscribeToDisconnect(guildId: string, callback: Callback): void

Add a callback to be called when this service disconnects from a channel.

Parameters

  • guildId: string

    Guild id of which guild to subscribe to.

  • callback: Callback

    Callback that will be called when voice channel is disconnected to.

Returns void

  • 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.