Coroutine based client for Lavalink (Kotlin and Java)


Lavakord is a coroutine based client for LavaLink mainly designed to work with Kord

Support discord:

Both Kord and kordx.lavalink is still in an experimental stage, as such we can't guarantee API stability between releases. While we'd love for you to try out our library, we don't recommend you use this in production just yet.

Lavalink download: Frederikam/Lavalink


You can get Lavakord from here:


You can create a Lavalink object like this

    val lavalink = kord.lavakord()

// or    

val lavalink = kord.lavakord {
    link {
        autoReconnect = false
        retry = linear(2.seconds, 60.seconds, 10)

You can obtain and use a Link like this

    val link = guild.getLink(lavalink)


// use lavalink stuff like player



Track loading

Lavakord provides a wrapper for the Lavalink Track loading API

You can load a Track by using Link.loadItem(query: String)


Since 0.3 Lavakord provides a Flow based way to listen for events.

val link: KordLink // = .../

val player = link.player

player.on<TrackStartEvent> {


For more info please use the example or Dokka docs


Since Lavakord 1.0 we use only Multiplatform Kotlin libraries but Ktor doesn't support Websockets when using Kotlin native yet see kordlib/kord#69 and ktorio/ktor#1215 for reference. Kord doesn't support Multiplatform because of the same issue as well

Other Discord API wrappers

Since 1.0 it should be possible to implement your own version of lavakord by implementing your own versions of the LavaKord and Link classes you can see a reference implementation in the kord package

Using with Kord

Add the kord artifact

Using with JDA

Apart from Kord there also is a JDA implementation. You can use it like the following. (Requires jda artifact)

var (lavakord, jda) = JDABuilder.createDefault("token").buildWithLavakord()
class Javakord {
    var container = new LavakordJDABuilder(JDABuilder.createDefault("token")).build();
    var jda = container.getJda();
    var lavakord = container.getLavakord();
    JavaLavakord javaLavakord = JavaInterop.createJavaInterface(lavakord);

The snippets work similarly for DefaultShardManagerBuilder as well.

Using with Java

Lavakord provides a compatibility layer for coroutines based on Java 8's CompletableFuture API . To access that interface please use the JavaInterop class. For all rest related features refer to the TrackUtil and RoutePlannerUtil classes. In order to use these methods please add the java or jda-java artifact

Full example can be found here

class Javakord {
    Lavakord lavakord;// = <lavakord build mechanism>
    JavaLavakord javaLavakord = JavaInterop.createJavaInterface(lavakord);
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.