All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.dev.schlaubi.lavakord.plugins.lavasrc.AppleMusicHelperFunctions.kt Maven / Gradle / Ivy

There is a newer version: 8.1.0
Show newest version
// 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")




© 2015 - 2024 Weber Informatics LLC | Privacy Policy