Package discord4j.voice
Interface VoiceConnectionRegistry
-
- All Known Implementing Classes:
LocalVoiceConnectionRegistry
@Experimental public interface VoiceConnectionRegistry
A centralized registry to holdVoiceConnectioninstances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Mono<Void>disconnect(Snowflake guildId)Disconnect aVoiceConnectionfor givenguildIdand remove it from the registry.Mono<VoiceConnection>getVoiceConnection(Snowflake guildId)Return the currentVoiceConnectionthis registry holds for a givenguildId.Mono<Void>registerVoiceConnection(Snowflake guildId, VoiceConnection voiceConnection)Register aVoiceConnectionfor a givenguildId, replacing any existing one.
-
-
-
Method Detail
-
getVoiceConnection
Mono<VoiceConnection> getVoiceConnection(Snowflake guildId)
Return the currentVoiceConnectionthis registry holds for a givenguildId.- Parameters:
guildId- the guild ID to fetch the current voice connection- Returns:
- a
MonoofVoiceConnectionfor the given guild if present, empty otherwise.
-
registerVoiceConnection
Mono<Void> registerVoiceConnection(Snowflake guildId, VoiceConnection voiceConnection)
Register aVoiceConnectionfor a givenguildId, replacing any existing one.- Parameters:
guildId- the guild ID to set the new voice connectionvoiceConnection- theVoiceConnectionto register- Returns:
- a
Monoindicating completion of the registration process, if an error happens it is emitted through theMono.
-
disconnect
Mono<Void> disconnect(Snowflake guildId)
Disconnect aVoiceConnectionfor givenguildIdand remove it from the registry. If no connection was present for the guild, this method does nothing.
-
-