public class VoiceChannelJoinSpec extends Object implements Spec<Mono<VoiceConnection>>
VoiceChannel
and handle the initialization of the resulting
VoiceConnection
.Constructor and Description |
---|
VoiceChannelJoinSpec(GatewayDiscordClient gateway,
VoiceChannel voiceChannel) |
Modifier and Type | Method and Description |
---|---|
Mono<VoiceConnection> |
asRequest() |
VoiceChannelJoinSpec |
setIpDiscoveryRetrySpec(RetrySpec ipDiscoveryRetrySpec)
Set the retry policy to apply when performing IP discovery.
|
VoiceChannelJoinSpec |
setIpDiscoveryTimeout(Duration ipDiscoveryTimeout)
Set the maximum amount of time to wait for a single attempt at performing the IP discovery procedure.
|
VoiceChannelJoinSpec |
setProvider(AudioProvider provider)
Configure the
AudioProvider to use in the created VoiceConnection . |
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.
|
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.
|
VoiceChannelJoinSpec |
setSelfDeaf(boolean selfDeaf)
Set whether to deafen this client when establishing a
VoiceConnection . |
VoiceChannelJoinSpec |
setSelfMute(boolean selfMute)
Set whether to mute this client when establishing a
VoiceConnection . |
VoiceChannelJoinSpec |
setSendTaskFactory(VoiceSendTaskFactory sendTaskFactory)
Configure the
VoiceSendTaskFactory to use in the created VoiceConnection . |
VoiceChannelJoinSpec |
setTimeout(Duration timeout)
Set the maximum amount of time to wait before the connection to the voice channel timeouts.
|
public VoiceChannelJoinSpec(GatewayDiscordClient gateway, VoiceChannel voiceChannel)
public VoiceChannelJoinSpec setProvider(AudioProvider provider)
AudioProvider
to use in the created VoiceConnection
.provider
- Used to send audio.@Deprecated public VoiceChannelJoinSpec setReceiver(AudioReceiver receiver)
AudioReceiver
to use in the created VoiceConnection
.receiver
- Used to receive audio.public VoiceChannelJoinSpec setSendTaskFactory(VoiceSendTaskFactory sendTaskFactory)
VoiceSendTaskFactory
to use in the created VoiceConnection
. A send task is created
when establishing a Voice Gateway session and is torn down when disconnecting.sendTaskFactory
- provides an audio send system that process outbound packets@Deprecated public VoiceChannelJoinSpec setReceiveTaskFactory(VoiceReceiveTaskFactory receiveTaskFactory)
VoiceReceiveTaskFactory
to use in the created VoiceConnection
. A receive task is
created when establishing a Voice Gateway session and is torn down when disconnecting.receiveTaskFactory
- provides an audio receive system to process inbound packetspublic VoiceChannelJoinSpec setSelfDeaf(boolean selfDeaf)
VoiceConnection
.selfDeaf
- if this client is deafenedpublic VoiceChannelJoinSpec setSelfMute(boolean selfMute)
VoiceConnection
.selfMute
- if this client is mutedpublic VoiceChannelJoinSpec setTimeout(Duration timeout)
Permission.VIEW_CHANNEL
or
when the voice channel is full.
The default value is seconds.timeout
- the maximum amount of time to wait before the connection to the voice channel timeoutspublic VoiceChannelJoinSpec setIpDiscoveryTimeout(Duration ipDiscoveryTimeout)
DEFAULT_DISCOVERY_TIMEOUT
seconds.ipDiscoveryTimeout
- the maximum amount of time to wait in a single attempt at IP discoverypublic VoiceChannelJoinSpec setIpDiscoveryRetrySpec(RetrySpec ipDiscoveryRetrySpec)
ipDiscoveryRetrySpec
- the maximum amount of time to wait in a single attempt at IP discoverypublic Mono<VoiceConnection> asRequest()
asRequest
in interface Spec<Mono<VoiceConnection>>