Package discord4j.voice
Class DefaultVoiceConnectionFactory
java.lang.Object
discord4j.voice.DefaultVoiceConnectionFactory
- All Implemented Interfaces:
VoiceConnectionFactory
Default implementation for a
VoiceConnectionFactory
. It uses a DefaultVoiceGatewayClient
to create
VoiceConnection
instances. Protects against concurrent create(VoiceGatewayOptions)
calls by sharing
the Mono
subscription that actually establishes a voice connection.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(VoiceGatewayOptions options) Return aMono
that, upon subscription, is able to obtain aVoiceConnection
from the givenVoiceGatewayOptions
.
-
Constructor Details
-
DefaultVoiceConnectionFactory
public DefaultVoiceConnectionFactory()
-
-
Method Details
-
create
Description copied from interface:VoiceConnectionFactory
Return aMono
that, upon subscription, is able to obtain aVoiceConnection
from the givenVoiceGatewayOptions
. The resulting connection can be an existing one if it's still active for a guild.- Specified by:
create
in interfaceVoiceConnectionFactory
- Parameters:
options
- the set of options to configure voice connections- Returns:
- a
Mono
that, upon subscription, can return aVoiceConnection
. In case an error occurs, it is emitted through theMono
.
-