Package discord4j.voice
Class LocalVoiceConnectionRegistry
java.lang.Object
discord4j.voice.LocalVoiceConnectionRegistry
- All Implemented Interfaces:
VoiceConnectionRegistry
A simple
VoiceConnectionRegistry that tracks local VoiceConnection instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondisconnect(Snowflake guildId) Disconnect aVoiceConnectionfor givenguildIdand remove it from the registry.getVoiceConnection(Snowflake guildId) Return the currentVoiceConnectionthis registry holds for a givenguildId.registerVoiceConnection(Snowflake guildId, VoiceConnection voiceConnection) Register aVoiceConnectionfor a givenguildId, replacing any existing one.
-
Constructor Details
-
LocalVoiceConnectionRegistry
public LocalVoiceConnectionRegistry()
-
-
Method Details
-
getVoiceConnection
Description copied from interface:VoiceConnectionRegistryReturn the currentVoiceConnectionthis registry holds for a givenguildId.- Specified by:
getVoiceConnectionin interfaceVoiceConnectionRegistry- Parameters:
guildId- the guild ID to fetch the current voice connection- Returns:
- a
MonoofVoiceConnectionfor the given guild if present, empty otherwise.
-
registerVoiceConnection
Description copied from interface:VoiceConnectionRegistryRegister aVoiceConnectionfor a givenguildId, replacing any existing one.- Specified by:
registerVoiceConnectionin interfaceVoiceConnectionRegistry- 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
Description copied from interface:VoiceConnectionRegistryDisconnect aVoiceConnectionfor givenguildIdand remove it from the registry. If no connection was present for the guild, this method does nothing.- Specified by:
disconnectin interfaceVoiceConnectionRegistry- Parameters:
guildId- the guild ID to disconnect and remove a voice connection- Returns:
- a
Monoindicating completion of the disconnection process, if an error happens it is emitted through theMono.
-