Class VoiceChannelJoinSpec

    • Method Detail

      • setReceiver

        @Deprecated
        public VoiceChannelJoinSpec setReceiver​(AudioReceiver receiver)
        Deprecated.
        Discord does not officially support bots receiving audio. It is not guaranteed that this functionality works properly. Use at your own risk.
        Configure the AudioReceiver to use in the created VoiceConnection.
        Parameters:
        receiver - Used to receive audio.
        Returns:
        This spec.
      • setSendTaskFactory

        public VoiceChannelJoinSpec setSendTaskFactory​(VoiceSendTaskFactory sendTaskFactory)
        Configure the VoiceSendTaskFactory to use in the created VoiceConnection. A send task is created when establishing a Voice Gateway session and is torn down when disconnecting.
        Parameters:
        sendTaskFactory - provides an audio send system that process outbound packets
        Returns:
        this spec
      • setReceiveTaskFactory

        @Deprecated
        public VoiceChannelJoinSpec setReceiveTaskFactory​(VoiceReceiveTaskFactory receiveTaskFactory)
        Deprecated.
        Discord does not officially support bots receiving audio. It is not guaranteed that this functionality works properly. Use at your own risk.
        Configure the VoiceReceiveTaskFactory to use in the created VoiceConnection. A receive task is created when establishing a Voice Gateway session and is torn down when disconnecting.
        Parameters:
        receiveTaskFactory - provides an audio receive system to process inbound packets
        Returns:
        this spec
      • setSelfDeaf

        public VoiceChannelJoinSpec setSelfDeaf​(boolean selfDeaf)
        Set whether to deafen this client when establishing a VoiceConnection.
        Parameters:
        selfDeaf - if this client is deafened
        Returns:
        this spec
      • setSelfMute

        public VoiceChannelJoinSpec setSelfMute​(boolean selfMute)
        Set whether to mute this client when establishing a VoiceConnection.
        Parameters:
        selfMute - if this client is muted
        Returns:
        this spec
      • setTimeout

        public VoiceChannelJoinSpec setTimeout​(Duration timeout)
        Set the maximum amount of time to wait before the connection to the voice channel timeouts. For example, the connection may get stuck when the bot does not have Permission.VIEW_CHANNEL or when the voice channel is full. The default value is 10 seconds.
        Parameters:
        timeout - the maximum amount of time to wait before the connection to the voice channel timeouts
        Returns:
        this spec
      • setIpDiscoveryTimeout

        public VoiceChannelJoinSpec setIpDiscoveryTimeout​(Duration ipDiscoveryTimeout)
        Set the maximum amount of time to wait for a single attempt at performing the IP discovery procedure. For more information about this procedure check IP discovery. The default value is DEFAULT_DISCOVERY_TIMEOUT seconds.
        Parameters:
        ipDiscoveryTimeout - the maximum amount of time to wait in a single attempt at IP discovery
        Returns:
        this spec
      • setIpDiscoveryRetrySpec

        public VoiceChannelJoinSpec setIpDiscoveryRetrySpec​(RetrySpec ipDiscoveryRetrySpec)
        Set the retry policy to apply when performing IP discovery. For more information about this procedure check IP discovery. The default value is retrying once before exiting.
        Parameters:
        ipDiscoveryRetrySpec - the maximum amount of time to wait in a single attempt at IP discovery
        Returns:
        this spec