commonMain.dev.schlaubi.lavakord.plugins.lavasrc.AppleMusicHelperFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lavasrc-jvm Show documentation
Show all versions of lavasrc-jvm Show documentation
Coroutine based client for Lavalink (Kotlin and Java)
// DO NOT EDIT!! - This code has been generated by QueryUtilityProcessor
// Edit this file instead lavasrc/src/commonMain/kotlin/QueryUtils.kt
@file:Suppress(names = arrayOf("IncorrectFormatting", "INVISIBLE_REFERENCE"))
package dev.schlaubi.lavakord.plugins.lavasrc
import dev.arbjerg.lavalink.protocol.v4.LoadResult
import dev.schlaubi.lavakord.audio.Node
import dev.schlaubi.lavakord.audio.player.PlayOptions
import dev.schlaubi.lavakord.audio.player.Player
import dev.schlaubi.lavakord.rest.loadItem
import kotlin.contracts.InvocationKind.EXACTLY_ONCE
import kotlin.contracts.contract
/**
* Performs a track search and plays the result using [Apple Music](https://music.apple.com).
*/
public suspend fun Player.searchAndPlayUsingAppleMusic(query: String,
playOptionsBuilder: PlayOptions.() -> Unit = {}) {
contract { callsInPlace(playOptionsBuilder, EXACTLY_ONCE) }
searchAndPlayTrack("amsearch:$query", playOptionsBuilder)
}
/**
* Performs a track search using [Apple Music](https://music.apple.com).
*/
public suspend fun Node.searchUsingAppleMusic(query: String): LoadResult =
loadItem("amsearch:$query")