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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(VoiceGatewayOptions options) Return aMonothat, upon subscription, is able to obtain aVoiceConnectionfrom the givenVoiceGatewayOptions.
-
Constructor Details
-
DefaultVoiceConnectionFactory
public DefaultVoiceConnectionFactory()
-
-
Method Details
-
create
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.
-