Class DirectAudioControllerImpl

java.lang.Object
net.dv8tion.jda.internal.managers.DirectAudioControllerImpl
All Implemented Interfaces:
DirectAudioController

public class DirectAudioControllerImpl extends Object implements DirectAudioController
  • Constructor Details

    • DirectAudioControllerImpl

      public DirectAudioControllerImpl(JDAImpl api)
  • Method Details

    • getJDA

      @Nonnull public JDAImpl getJDA()
      Description copied from interface: DirectAudioController
      The associated JDA instance
      Specified by:
      getJDA in interface DirectAudioController
      Returns:
      The JDA instance
    • connect

      public void connect(@Nonnull AudioChannel channel)
      Description copied from interface: DirectAudioController
      Requests a voice server endpoint for connecting to the voice gateway.
      Specified by:
      connect in interface DirectAudioController
      Parameters:
      channel - The channel to connect to
      See Also:
    • disconnect

      public void disconnect(@Nonnull Guild guild)
      Description copied from interface: DirectAudioController
      Requests to terminate the connection to a voice channel.
      Specified by:
      disconnect in interface DirectAudioController
      Parameters:
      guild - The guild we were connected to
      See Also:
    • reconnect

      public void reconnect(@Nonnull AudioChannel channel)
      Description copied from interface: DirectAudioController
      Requests to reconnect to the voice channel in the target guild.
      Specified by:
      reconnect in interface DirectAudioController
      Parameters:
      channel - The channel we were connected to
    • update

      public void update(Guild guild, AudioChannel channel)
      Used to update the internal state of the voice request. When a connection was successfully established JDA will stop sending requests for the initial connect.
      This is done to retry the voice updates in case of a partial service failure.

      Should be called when:

      1. Receiving a Voice State Update for the current account and we were previously connected (moved or disconnected)
      2. Receiving a Voice Server Update (initial connect or region change)
      Note that the voice state update will always be received prior to a voice server update.
      The internal dispatch handlers already call this when needed, a library end-user never needs to call this method.
      Parameters:
      guild - The guild to update the state for
      channel - The new channel, or null to signal disconnect