fix: bot now doesn't leave when failing to find a song with no song in queue and one playing
Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
parent
9b51693a75
commit
3d66548a3d
1 changed files with 6 additions and 3 deletions
|
@ -31,7 +31,10 @@ import dev.kord.rest.builder.message.embed
|
|||
import dev.schlaubi.lavakord.audio.Link
|
||||
import dev.schlaubi.lavakord.audio.player.Player
|
||||
import dev.schlaubi.lavakord.rest.loadItem
|
||||
import net.moonleay.botendo.util.*
|
||||
import net.moonleay.botendo.util.ButtonUtil
|
||||
import net.moonleay.botendo.util.MessageUtil
|
||||
import net.moonleay.botendo.util.TimeUtil
|
||||
import net.moonleay.botendo.util.UrlUtil
|
||||
|
||||
object MusicManager {
|
||||
private var musicManagerMap: MutableMap<Snowflake, GuildTrackScheduler> = mutableMapOf()
|
||||
|
@ -185,7 +188,7 @@ object MusicManager {
|
|||
|
||||
}
|
||||
is LoadResult.NoMatches -> {
|
||||
if(gts.isEmpty()) {
|
||||
if (gts.isEmpty() && player.playingTrack == null) {
|
||||
player.stopTrack()
|
||||
link.destroy()
|
||||
}
|
||||
|
@ -202,7 +205,7 @@ object MusicManager {
|
|||
}
|
||||
}
|
||||
is LoadResult.LoadFailed -> {
|
||||
if (gts.isEmpty()) {
|
||||
if (gts.isEmpty() && player.playingTrack == null) {
|
||||
player.stopTrack()
|
||||
link.destroy()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue