net.bjoernpetersen.musicbot.spi.loader.SongLoader.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of musicbot Show documentation
Show all versions of musicbot Show documentation
Core library of JMusicBot, which plays music from various providers.
package net.bjoernpetersen.musicbot.spi.loader
import net.bjoernpetersen.musicbot.api.player.Song
import net.bjoernpetersen.musicbot.spi.plugin.Provider
/**
* Responsible for loading songs by calling [Provider.loadSong].
*/
interface SongLoader {
/**
* Loads the specified [song] using the specified [provider].
*
* @param provider a provider capable of loading [song]
* @param song a song to be loaded
* @return a future eventually yielding the result of [Provider.loadSong]
*/
suspend fun load(provider: Provider, song: Song): Resource
suspend fun close()
}