Interface VoiceConnectionRegistry

All Known Implementing Classes:
LocalVoiceConnectionRegistry

@Experimental public interface VoiceConnectionRegistry
A centralized registry to hold VoiceConnection instances.
  • Method Details

    • getVoiceConnection

      Mono<VoiceConnection> getVoiceConnection(Snowflake guildId)
      Return the current VoiceConnection this registry holds for a given guildId.
      Parameters:
      guildId - the guild ID to fetch the current voice connection
      Returns:
      a Mono of VoiceConnection for the given guild if present, empty otherwise.
    • registerVoiceConnection

      Mono<Void> registerVoiceConnection(Snowflake guildId, VoiceConnection voiceConnection)
      Register a VoiceConnection for a given guildId, replacing any existing one.
      Parameters:
      guildId - the guild ID to set the new voice connection
      voiceConnection - the VoiceConnection to register
      Returns:
      a Mono indicating completion of the registration process, if an error happens it is emitted through the Mono.
    • disconnect

      Mono<Void> disconnect(Snowflake guildId)
      Disconnect a VoiceConnection for given guildId and remove it from the registry. If no connection was present for the guild, this method does nothing.
      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 the Mono.