Skip to content

Commit

Permalink
3.0
Browse files Browse the repository at this point in the history
- Fix bug preventing usage of AudioResultHandler callback when using search
- Fix deserialization of route planner API
- Update documentation
- Add Flow based event support like Kord
  • Loading branch information
DRSchlaubi committed Nov 4, 2020
1 parent d370eb2 commit 9370d10
Show file tree
Hide file tree
Showing 144 changed files with 6,120 additions and 1,295 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,23 @@ You can obtain and use a `Link` like this

Playing: https://github.com/DRSchlaubi/Lavakord/blob/master/example/src/main/kotlin/me/schlaubi/lavakord/example/Lavakord.kt#L101-L122

# Track loading
Lavakord provides a wrapper for the Lavalink [Track loading API](https://github.com/Frederikam/Lavalink/blob/master/IMPLEMENTATION.md#track-loading-api)

You can load a Track by using `Link.loadItem(query: String)` for a couroutine based aproach or `Link.loadItem(query: String, callback: AudioLoadResultHandler)` for a callback based approach like Lavaplayer

# Events
Since 0.3 Lavakord provides a [Flow based](https://kotlinlang.org/docs/reference/coroutines/flow.html) way to listen for events.

```kotlin
val link: KordLink // = .../

val player = link.player

player.on<TrackStartEvent> {
channel.createMessage(track.info.asString())
}
```

# Documentation
For more info please use the [example](https://github.com/DRSchlaubi/Lavakord/blob/master/example) or [Dokka docs](https://l.mik.wtf/lavakord/)
7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.jfrog.bintray.gradle.BintrayExtension
import java.net.URL

plugins {
kotlin("jvm") version "1.4.10"
kotlin("plugin.serialization") version "1.4.0"
id("com.jfrog.bintray") version "1.8.5"
id("org.jetbrains.dokka") version "1.4.0"
id("org.jetbrains.dokka") version "1.4.10"
`maven-publish`
}

Expand All @@ -22,7 +21,9 @@ repositories {

dependencies {
implementation("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.0.0")
compileOnly("com.gitlab.kordlib.kord", "kord-core", "0.6.4")
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.4.1")

compileOnly("com.gitlab.kordlib.kord", "kord-core", "0.6.7")

api("com.github.FredBoat", "Lavalink-Client", "4.0")
testImplementation(kotlin("test-junit"))
Expand Down
2 changes: 2 additions & 0 deletions docs/-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>Search</title>
<link href="images/logo-icon.svg" rel="icon" type="image/svg">
<link href="styles/style.css" rel="Stylesheet">
<script type="text/javascript" src="scripts/pages.js" async="async"></script>
<script type="text/javascript" src="scripts/search.js" async="async"></script>
Expand All @@ -15,6 +16,7 @@
<div id="sideMenu"></div>
</div>
<div id="main">
<div id="leftToggler"><span class="icon-toggler"></span></div>
<div id="searchBar"></div>
<script type="text/javascript" src="scripts/pages.js"></script>
<script type="text/javascript" src="scripts/main.js"></script>
Expand Down
17 changes: 15 additions & 2 deletions docs/lavakord/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>lavakord</title>
<link href="../images/logo-icon.svg" rel="icon" type="image/svg">
<link href="../styles/style.css" rel="Stylesheet">
<script type="text/javascript" src="../scripts/navigationLoader.js" async="async"></script>
<script type="text/javascript" src="../scripts/platformContentHandler.js" async="async"></script>
Expand All @@ -18,6 +19,7 @@
<div id="sideMenu"></div>
</div>
<div id="main">
<div id="leftToggler"><span class="icon-toggler"></span></div>
<div id="searchBar"></div>
<script type="text/javascript" src="../scripts/pages.js"></script>
<script type="text/javascript" src="../scripts/main.js"></script>
Expand All @@ -28,7 +30,7 @@ <h1 class="cover"><a data-name="lavakord"></a><span>lavakord</span></h1>
</div>
<h2 class=""><a data-name="packages"></a>Packages</h2>
<div class="table"><a data-name="me.schlaubi.lavakord////PointingToDeclaration/"></a>
<div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
<div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main">
<div class="main-subrow "><span><a href="me.schlaubi.lavakord/index.html">me.schlaubi.lavakord</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="me.schlaubi.lavakord////PointingToDeclaration/"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.2496 5.3C20.3496 4.5 19.2496 4 18.0496 4C16.8496 4 15.6496 4.5 14.8496 5.3L10.3496 9.8L11.7496 11.2L16.2496 6.7C17.2496 5.7 18.8496 5.7 19.8496 6.7C20.8496 7.7 20.8496 9.3 19.8496 10.3L15.3496 14.8L16.7496 16.2L21.2496 11.7C22.1496 10.8 22.5496 9.7 22.5496 8.5C22.5496 7.3 22.1496 6.2 21.2496 5.3Z"/>
<path d="M8.35 16.7998C7.35 17.7998 5.75 17.7998 4.75 16.7998C3.75 15.7998 3.75 14.1998 4.75 13.1998L9.25 8.6998L7.85 7.2998L3.35 11.7998C1.55 13.5998 1.55 16.3998 3.35 18.1998C4.25 19.0998 5.35 19.4998 6.55 19.4998C7.75 19.4998 8.85 19.0998 9.75 18.1998L14.25 13.6998L12.85 12.2998L8.35 16.7998Z"/>
Expand All @@ -38,8 +40,19 @@ <h2 class=""><a data-name="packages"></a>Packages</h2>
</svg><span>Link copied to clipboard</span></div>
</span></span></div>
</div>
<a data-name="me.schlaubi.lavakord.audio////PointingToDeclaration/"></a>
<div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main">
<div class="main-subrow "><span><a href="me.schlaubi.lavakord.audio/index.html">me.schlaubi.lavakord.audio</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="me.schlaubi.lavakord.audio////PointingToDeclaration/"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.2496 5.3C20.3496 4.5 19.2496 4 18.0496 4C16.8496 4 15.6496 4.5 14.8496 5.3L10.3496 9.8L11.7496 11.2L16.2496 6.7C17.2496 5.7 18.8496 5.7 19.8496 6.7C20.8496 7.7 20.8496 9.3 19.8496 10.3L15.3496 14.8L16.7496 16.2L21.2496 11.7C22.1496 10.8 22.5496 9.7 22.5496 8.5C22.5496 7.3 22.1496 6.2 21.2496 5.3Z"/>
<path d="M8.35 16.7998C7.35 17.7998 5.75 17.7998 4.75 16.7998C3.75 15.7998 3.75 14.1998 4.75 13.1998L9.25 8.6998L7.85 7.2998L3.35 11.7998C1.55 13.5998 1.55 16.3998 3.35 18.1998C4.25 19.0998 5.35 19.4998 6.55 19.4998C7.75 19.4998 8.85 19.0998 9.75 18.1998L14.25 13.6998L12.85 12.2998L8.35 16.7998Z"/>
</svg></span>
<div class="copy-popup-wrapper "><svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 9C18 14 14 18 9 18C4 18 0 14 0 9C0 4 4 0 9 0C14 0 18 4 18 9ZM14.2 6.2L12.8 4.8L7.5 10.1L5.3 7.8L3.8 9.2L7.5 13L14.2 6.2Z" fill="#4DBB5F"/>
</svg><span>Link copied to clipboard</span></div>
</span></span></div>
</div>
<a data-name="me.schlaubi.lavakord.rest////PointingToDeclaration/"></a>
<div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
<div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main">
<div class="main-subrow "><span><a href="me.schlaubi.lavakord.rest/index.html">me.schlaubi.lavakord.rest</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="me.schlaubi.lavakord.rest////PointingToDeclaration/"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.2496 5.3C20.3496 4.5 19.2496 4 18.0496 4C16.8496 4 15.6496 4.5 14.8496 5.3L10.3496 9.8L11.7496 11.2L16.2496 6.7C17.2496 5.7 18.8496 5.7 19.8496 6.7C20.8496 7.7 20.8496 9.3 19.8496 10.3L15.3496 14.8L16.7496 16.2L21.2496 11.7C22.1496 10.8 22.5496 9.7 22.5496 8.5C22.5496 7.3 22.1496 6.2 21.2496 5.3Z"/>
<path d="M8.35 16.7998C7.35 17.7998 5.75 17.7998 4.75 16.7998C3.75 15.7998 3.75 14.1998 4.75 13.1998L9.25 8.6998L7.85 7.2998L3.35 11.7998C1.55 13.5998 1.55 16.3998 3.35 18.1998C4.25 19.0998 5.35 19.4998 6.55 19.4998C7.75 19.4998 8.85 19.0998 9.75 18.1998L14.25 13.6998L12.85 12.2998L8.35 16.7998Z"/>
Expand Down
Loading

0 comments on commit 9370d10

Please sign in to comment.