From c8d7003ef598b2e898443593ea51c80b6705538e Mon Sep 17 00:00:00 2001 From: limited_dev Date: Wed, 19 Apr 2023 21:18:46 +0200 Subject: [PATCH] fix: fixed issues with the "is in vc" check chore: update README.md Signed-off-by: limited_dev --- README.md | 10 ++++++++-- build.gradle.kts | 2 +- .../botendo/extensions/music/NowPlayingExt.kt | 8 ++++++-- .../limited_dev/botendo/extensions/music/QueueExt.kt | 2 +- .../de/limited_dev/botendo/extensions/music/SkipExt.kt | 2 +- .../de/limited_dev/botendo/extensions/music/StopExt.kt | 2 +- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 350642f..33739da 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,19 @@ A Discord music bot, written in Kotlin using the kord library. limited_dev: Owner & Developer +## Special Thanks to + +- HopeBaron for taking the time to help me fix this pos. + ## Commands - info -- Show basic infos about the bot - play -- Play a song - stop -- Stop playing a song and leave the vc -## How to self-host +## How to self-host (using the Docker container) + +## How to self-host (using the JAR) 1. Download the latest release from the Package Registry ("Packages and registries" > "Package Registry") 1. It should be called something like this: "Botendo-X.X.X-xxxxxxxx-prod.jar" (replace "X.X.X" with the latest @@ -31,7 +37,7 @@ A Discord music bot, written in Kotlin using the kord library. 2. Place it anywhere you want. 3. Run the following command: > java -jar Botendo-X.X.X-xxxxxxxx-prod.jar -4. The bot should start and create a config file named "credentials.nils" +4. The bot should start and create a config file named "credentials.nils" in a folder called "data" 5. Open it and put in your credentials. 1. token: your Discord bot token 2. lavaip: the IP of your LavaLink instance e.g.: ("ws://192.168.178.1:2333") diff --git a/build.gradle.kts b/build.gradle.kts index 73431e1..5e69edf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -33,7 +33,7 @@ val ownerID = 372703841151614976L group = "de.limited_dev.botendo" version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" } ?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" } - ?: "6.1.0" + ?: "6.1.1" val kordver = "1.5.6" val lavaver = "3.8.0" diff --git a/src/main/kotlin/de/limited_dev/botendo/extensions/music/NowPlayingExt.kt b/src/main/kotlin/de/limited_dev/botendo/extensions/music/NowPlayingExt.kt index c243c27..d9cb197 100644 --- a/src/main/kotlin/de/limited_dev/botendo/extensions/music/NowPlayingExt.kt +++ b/src/main/kotlin/de/limited_dev/botendo/extensions/music/NowPlayingExt.kt @@ -38,7 +38,7 @@ class NowPlayingExt : Extension() { val guildId = this.guild!!.id val link = Bot.lava.getLink(guildId) val player = link.player - if (link.state != Link.State.CONNECTED) { + if (link.state == Link.State.NOT_CONNECTED) { MessageUtil.sendEmbedForPublicSlashCommand( this, "Not connected", @@ -58,7 +58,11 @@ class NowPlayingExt : Extension() { MessageUtil.sendEmbedForPublicSlashCommandWithImage( this, "Currently playing", - "**${track.title}**\n*Now Playing*\nby ${track.author} :: ${ + "**${track.title}**\n*Now Playing*\nby ${track.author} :${ + TimeUtil.getTimeFormatedRaw( + track.position.inWholeMilliseconds + ) + }: ${ TimeUtil.getTimeFormatedRaw( track.length.inWholeMilliseconds ) diff --git a/src/main/kotlin/de/limited_dev/botendo/extensions/music/QueueExt.kt b/src/main/kotlin/de/limited_dev/botendo/extensions/music/QueueExt.kt index ce29e01..9448c0e 100644 --- a/src/main/kotlin/de/limited_dev/botendo/extensions/music/QueueExt.kt +++ b/src/main/kotlin/de/limited_dev/botendo/extensions/music/QueueExt.kt @@ -37,7 +37,7 @@ class QueueExt : Extension() { val guildId = this.guild!!.id val link = Bot.lava.getLink(guildId.toString()) val player = link.player - if (link.state != Link.State.CONNECTED) { + if (link.state == Link.State.NOT_CONNECTED) { MessageUtil.sendEmbedForPublicSlashCommand( this, "Not connected", diff --git a/src/main/kotlin/de/limited_dev/botendo/extensions/music/SkipExt.kt b/src/main/kotlin/de/limited_dev/botendo/extensions/music/SkipExt.kt index c274277..1fbbdc9 100644 --- a/src/main/kotlin/de/limited_dev/botendo/extensions/music/SkipExt.kt +++ b/src/main/kotlin/de/limited_dev/botendo/extensions/music/SkipExt.kt @@ -50,7 +50,7 @@ class SkipExt : Extension() { } val channelId = voiceState.channelId - if (link.state != Link.State.CONNECTED) { + if (link.state == Link.State.NOT_CONNECTED) { MessageUtil.sendEmbedForPublicSlashCommand( this, "Not connected", diff --git a/src/main/kotlin/de/limited_dev/botendo/extensions/music/StopExt.kt b/src/main/kotlin/de/limited_dev/botendo/extensions/music/StopExt.kt index 8a4292c..6c12501 100644 --- a/src/main/kotlin/de/limited_dev/botendo/extensions/music/StopExt.kt +++ b/src/main/kotlin/de/limited_dev/botendo/extensions/music/StopExt.kt @@ -52,7 +52,7 @@ class StopExt : Extension() { return@action } val channelId = vcsUser.channelId - if (link.state != Link.State.CONNECTED) { + if (link.state == Link.State.NOT_CONNECTED) { this.respond { this.embeds.add( MessageUtil.getEmbed(