Interface AudioConnection

    • Method Detail

      • moveTo

        CompletableFuture<Void> moveTo​(ServerVoiceChannel destChannel)
        Moves the connection to a different channel. The channel must be in the same server as the current connection.
        Parameters:
        destChannel - The channel to move to.
        Returns:
        A CompletableFuture indicating whether or not the move was successful.
      • moveTo

        CompletableFuture<Void> moveTo​(ServerVoiceChannel destChannel,
                                       boolean selfMute,
                                       boolean selfDeafen)
        Moves the connection to a different channel. The channel must be in the same server as the current connection.
        Parameters:
        destChannel - The channel to move to.
        selfMute - Whether or not to be self-muted on join.
        selfDeafen - Whether or not to be self-deafened on join.
        Returns:
        A CompletableFuture indicating whether or not the move was successful.
      • close

        CompletableFuture<Void> close​()
        Disconnects from the voice channel.

        A disconnected audio connection cannot be reused!

        Returns:
        A CompletableFuture which completes when the connection has been disconnected.
      • getAudioSource

        Optional<AudioSource> getAudioSource​()
        Gets the audio source.
        Returns:
        The audio source.
      • setAudioSource

        void setAudioSource​(AudioSource source)
        Sets the audio source, replacing any currently playing source.
        Parameters:
        source - The audio source which will become the source.
      • removeAudioSource

        void removeAudioSource​()
        Removes the audio source.
      • getChannel

        ServerVoiceChannel getChannel​()
        Gets the voice channel of the audio connection.
        Returns:
        The voice channel of the audio connection.
      • isSelfMuted

        boolean isSelfMuted​()
        Gets the self-muted status of this connection.

        This is solely visual. A muted bot can still play audio.

        Returns:
        Whether or not the connection is self-muted.
      • setSelfMuted

        void setSelfMuted​(boolean muted)
        Sets the self-muted status of this connection.

        This is solely visual. A muted bot can still play audio.

        Parameters:
        muted - Whether or not to self-mute this connection.
      • isSelfDeafened

        boolean isSelfDeafened​()
        Gets the self-deafened status of this connection.

        This is solely visual. A deafened bot can still receive audio.

        Returns:
        Whether or not the connection is self-deafened.
      • setSelfDeafened

        void setSelfDeafened​(boolean deafened)
        Sets the self-deafened status of this connection.

        This is solely visual. A deafened bot can still receive audio.

        Parameters:
        deafened - Whether or not to self-deafen this connection.
      • isPrioritySpeaking

        boolean isPrioritySpeaking​()
        Gets the priority speaker status of this connection.
        Returns:
        Whether or not the connection is priority speaking.
      • setPrioritySpeaking

        void setPrioritySpeaking​(boolean prioritySpeaking)
        Sets the priority speaker status of this connection.
        Parameters:
        prioritySpeaking - Whether or not to become a priority speaker.
      • getSpeakingFlags

        Set<SpeakingFlag> getSpeakingFlags​()
        Gets the speaking flags of this connection.
        Returns:
        The current speaking flags of this connection.
      • getServer

        default Server getServer​()
        Gets the server of the audio connection.
        Returns:
        The server of the audio connection.