fix: fixed issues with the "is in vc" check

chore: update README.md

Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
limited_dev 2023-04-19 21:18:46 +02:00
parent 16069d6ccd
commit c8d7003ef5
6 changed files with 18 additions and 8 deletions

View file

@ -15,13 +15,19 @@ A Discord music bot, written in Kotlin using the kord library.
<img src="https://img.shields.io/badge/limited__dev-Owner%20%26%20Developer-blue" alt="limited_dev: Owner & Developer"/> <img src="https://img.shields.io/badge/limited__dev-Owner%20%26%20Developer-blue" alt="limited_dev: Owner & Developer"/>
</div> </div>
## Special Thanks to
- HopeBaron for taking the time to help me fix this pos.
## Commands ## Commands
- info -- Show basic infos about the bot - info -- Show basic infos about the bot
- play -- Play a song - play -- Play a song
- stop -- Stop playing a song and leave the vc - 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. 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 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. 2. Place it anywhere you want.
3. Run the following command: 3. Run the following command:
> java -jar Botendo-X.X.X-xxxxxxxx-prod.jar > 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. 5. Open it and put in your credentials.
1. token: your Discord bot token 1. token: your Discord bot token
2. lavaip: the IP of your LavaLink instance e.g.: ("ws://192.168.178.1:2333") 2. lavaip: the IP of your LavaLink instance e.g.: ("ws://192.168.178.1:2333")

View file

@ -33,7 +33,7 @@ val ownerID = 372703841151614976L
group = "de.limited_dev.botendo" group = "de.limited_dev.botendo"
version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" } version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" }
?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" } ?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" }
?: "6.1.0" ?: "6.1.1"
val kordver = "1.5.6" val kordver = "1.5.6"
val lavaver = "3.8.0" val lavaver = "3.8.0"

View file

@ -38,7 +38,7 @@ class NowPlayingExt : Extension() {
val guildId = this.guild!!.id val guildId = this.guild!!.id
val link = Bot.lava.getLink(guildId) val link = Bot.lava.getLink(guildId)
val player = link.player val player = link.player
if (link.state != Link.State.CONNECTED) { if (link.state == Link.State.NOT_CONNECTED) {
MessageUtil.sendEmbedForPublicSlashCommand( MessageUtil.sendEmbedForPublicSlashCommand(
this, this,
"Not connected", "Not connected",
@ -58,7 +58,11 @@ class NowPlayingExt : Extension() {
MessageUtil.sendEmbedForPublicSlashCommandWithImage( MessageUtil.sendEmbedForPublicSlashCommandWithImage(
this, this,
"Currently playing", "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( TimeUtil.getTimeFormatedRaw(
track.length.inWholeMilliseconds track.length.inWholeMilliseconds
) )

View file

@ -37,7 +37,7 @@ class QueueExt : Extension() {
val guildId = this.guild!!.id val guildId = this.guild!!.id
val link = Bot.lava.getLink(guildId.toString()) val link = Bot.lava.getLink(guildId.toString())
val player = link.player val player = link.player
if (link.state != Link.State.CONNECTED) { if (link.state == Link.State.NOT_CONNECTED) {
MessageUtil.sendEmbedForPublicSlashCommand( MessageUtil.sendEmbedForPublicSlashCommand(
this, this,
"Not connected", "Not connected",

View file

@ -50,7 +50,7 @@ class SkipExt : Extension() {
} }
val channelId = voiceState.channelId val channelId = voiceState.channelId
if (link.state != Link.State.CONNECTED) { if (link.state == Link.State.NOT_CONNECTED) {
MessageUtil.sendEmbedForPublicSlashCommand( MessageUtil.sendEmbedForPublicSlashCommand(
this, this,
"Not connected", "Not connected",

View file

@ -52,7 +52,7 @@ class StopExt : Extension() {
return@action return@action
} }
val channelId = vcsUser.channelId val channelId = vcsUser.channelId
if (link.state != Link.State.CONNECTED) { if (link.state == Link.State.NOT_CONNECTED) {
this.respond { this.respond {
this.embeds.add( this.embeds.add(
MessageUtil.getEmbed( MessageUtil.getEmbed(