Package discord4j.voice
Class DefaultVoiceConnectionFactory
- java.lang.Object
-
- discord4j.voice.DefaultVoiceConnectionFactory
-
- All Implemented Interfaces:
VoiceConnectionFactory
public class DefaultVoiceConnectionFactory extends Object implements VoiceConnectionFactory
Default implementation for aVoiceConnectionFactory. It uses aDefaultVoiceGatewayClientto createVoiceConnectioninstances. Protects against concurrentcreate(VoiceGatewayOptions)calls by sharing theMonosubscription that actually establishes a voice connection.
-
-
Constructor Summary
Constructors Constructor Description DefaultVoiceConnectionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<VoiceConnection>create(VoiceGatewayOptions options)Return aMonothat, upon subscription, is able to obtain aVoiceConnectionfrom the givenVoiceGatewayOptions.
-
-
-
Method Detail
-
create
public Mono<VoiceConnection> create(VoiceGatewayOptions options)
Description copied from interface:VoiceConnectionFactoryReturn aMonothat, upon subscription, is able to obtain aVoiceConnectionfrom the givenVoiceGatewayOptions. The resulting connection can be an existing one if it's still active for a guild.- Specified by:
createin interfaceVoiceConnectionFactory- Parameters:
options- the set of options to configure voice connections- Returns:
- a
Monothat, upon subscription, can return aVoiceConnection. In case an error occurs, it is emitted through theMono.
-
-