Package discord4j.core.spec.legacy
Class LegacyVoiceChannelJoinSpec
- java.lang.Object
-
- discord4j.core.spec.legacy.LegacyVoiceChannelJoinSpec
-
- All Implemented Interfaces:
LegacySpec<Mono<VoiceConnection>>
public class LegacyVoiceChannelJoinSpec extends Object implements LegacySpec<Mono<VoiceConnection>>
LegacySpec used to request a connection to aVoiceChanneland handle the initialization of the resultingVoiceConnection.
-
-
Constructor Summary
Constructors Constructor Description LegacyVoiceChannelJoinSpec(GatewayDiscordClient gateway, VoiceChannel voiceChannel)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Mono<VoiceConnection>asRequest()LegacyVoiceChannelJoinSpecLegacysetIpDiscoveryRetrySpec(RetrySpec LegacyipDiscoveryRetrySpec)Set the retry policy to apply when performing IP discovery.LegacyVoiceChannelJoinSpecsetIpDiscoveryTimeout(Duration ipDiscoveryTimeout)Set the maximum amount of time to wait for a single attempt at performing the IP discovery procedure.LegacyVoiceChannelJoinSpecsetProvider(AudioProvider provider)Configure theAudioProviderto use in the createdVoiceConnection.LegacyVoiceChannelJoinSpecsetReceiver(AudioReceiver receiver)Deprecated.Discord does not officially support bots receiving audio.LegacyVoiceChannelJoinSpecsetReceiveTaskFactory(VoiceReceiveTaskFactory receiveTaskFactory)Deprecated.Discord does not officially support bots receiving audio.LegacyVoiceChannelJoinSpecsetSelfDeaf(boolean selfDeaf)Set whether to deafen this client when establishing aVoiceConnection.LegacyVoiceChannelJoinSpecsetSelfMute(boolean selfMute)Set whether to mute this client when establishing aVoiceConnection.LegacyVoiceChannelJoinSpecsetSendTaskFactory(VoiceSendTaskFactory sendTaskFactory)Configure theVoiceSendTaskFactoryto use in the createdVoiceConnection.LegacyVoiceChannelJoinSpecsetTimeout(Duration timeout)Set the maximum amount of time to wait before the connection to the voice channel timeouts.
-
-
-
Constructor Detail
-
LegacyVoiceChannelJoinSpec
public LegacyVoiceChannelJoinSpec(GatewayDiscordClient gateway, VoiceChannel voiceChannel)
-
-
Method Detail
-
setProvider
public LegacyVoiceChannelJoinSpec setProvider(AudioProvider provider)
Configure theAudioProviderto use in the createdVoiceConnection.- Parameters:
provider- Used to send audio.- Returns:
- This spec.
-
setReceiver
@Deprecated public LegacyVoiceChannelJoinSpec 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 theAudioReceiverto use in the createdVoiceConnection.- Parameters:
receiver- Used to receive audio.- Returns:
- This spec.
-
setSendTaskFactory
public LegacyVoiceChannelJoinSpec setSendTaskFactory(VoiceSendTaskFactory sendTaskFactory)
Configure theVoiceSendTaskFactoryto use in the createdVoiceConnection. 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 LegacyVoiceChannelJoinSpec 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 theVoiceReceiveTaskFactoryto use in the createdVoiceConnection. 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 LegacyVoiceChannelJoinSpec setSelfDeaf(boolean selfDeaf)
Set whether to deafen this client when establishing aVoiceConnection.- Parameters:
selfDeaf- if this client is deafened- Returns:
- this spec
-
setSelfMute
public LegacyVoiceChannelJoinSpec setSelfMute(boolean selfMute)
Set whether to mute this client when establishing aVoiceConnection.- Parameters:
selfMute- if this client is muted- Returns:
- this spec
-
setTimeout
public LegacyVoiceChannelJoinSpec 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 havePermission.VIEW_CHANNELor 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 LegacyVoiceChannelJoinSpec 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 isDEFAULT_DISCOVERY_TIMEOUTseconds.- Parameters:
ipDiscoveryTimeout- the maximum amount of time to wait in a single attempt at IP discovery- Returns:
- this spec
-
LegacysetIpDiscoveryRetrySpec
public LegacyVoiceChannelJoinSpec LegacysetIpDiscoveryRetrySpec(RetrySpec LegacyipDiscoveryRetrySpec)
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:
LegacyipDiscoveryRetrySpec- the maximum amount of time to wait in a single attempt at IP discovery- Returns:
- this spec
-
asRequest
public Mono<VoiceConnection> asRequest()
- Specified by:
asRequestin interfaceLegacySpec<Mono<VoiceConnection>>
-
-