Skip to content

Commit

Permalink
Fix skip command with auto-play
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Sep 28, 2024
1 parent 887df06 commit fc67535
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion music/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
subprojects {
version = "3.11.0-SNAPSHOT"
version = "3.11.1-SNAPSHOT"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ suspend fun MusicModule.skipCommand() = ephemeralControlSlashCommand(::SkipArgum
respond { content = translate("commands.skip.empty") }
return@action
}
if (arguments.to > musicPlayer.queuedTracks.size) {
if (arguments.to > (musicPlayer.queuedTracks.size + musicPlayer.autoPlayTrackCount)) {
respond {
content = translate("commands.skip.exceeds_range")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class MusicPlayer(val link: Link, private val guild: GuildBehavior) : Link by li
get() = guild.kord
val hasAutoPlay: Boolean
get() = !autoPlay?.songs.isNullOrEmpty()
val autoPlayTrackCount
get() = autoPlay?.songs?.size ?: 0

init {
guild.kord.launch {
Expand Down

0 comments on commit fc67535

Please sign in to comment.