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 aVoiceConnection
for givenguildId
and remove it from the registry.getVoiceConnection
(Snowflake guildId) Return the currentVoiceConnection
this registry holds for a givenguildId
.registerVoiceConnection
(Snowflake guildId, VoiceConnection voiceConnection) Register aVoiceConnection
for a givenguildId
, replacing any existing one.
-
Constructor Details
-
LocalVoiceConnectionRegistry
public LocalVoiceConnectionRegistry()
-
-
Method Details
-
getVoiceConnection
Description copied from interface:VoiceConnectionRegistry
Return the currentVoiceConnection
this registry holds for a givenguildId
.- Specified by:
getVoiceConnection
in interfaceVoiceConnectionRegistry
- Parameters:
guildId
- the guild ID to fetch the current voice connection- Returns:
- a
Mono
ofVoiceConnection
for the given guild if present, empty otherwise.
-
registerVoiceConnection
Description copied from interface:VoiceConnectionRegistry
Register aVoiceConnection
for a givenguildId
, replacing any existing one.- Specified by:
registerVoiceConnection
in interfaceVoiceConnectionRegistry
- Parameters:
guildId
- the guild ID to set the new voice connectionvoiceConnection
- theVoiceConnection
to register- Returns:
- a
Mono
indicating completion of the registration process, if an error happens it is emitted through theMono
.
-
disconnect
Description copied from interface:VoiceConnectionRegistry
Disconnect aVoiceConnection
for givenguildId
and remove it from the registry. If no connection was present for the guild, this method does nothing.- Specified by:
disconnect
in interfaceVoiceConnectionRegistry
- Parameters:
guildId
- the guild ID to disconnect and remove a voice connection- Returns:
- a
Mono
indicating completion of the disconnection process, if an error happens it is emitted through theMono
.
-