File tree Expand file tree Collapse file tree 4 files changed +2
-8
lines changed
java/fredboat/audio/player
kotlin/me/duncte123/skybot/commands/music Expand file tree Collapse file tree 4 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -111,11 +111,7 @@ public boolean isConnected(long guildId) {
111111
112112 final var link = lavalink .getLinkIfCached (guildId );
113113
114- if (link == null ) {
115- return false ;
116- }
117-
118- return link .getState () == LinkState .CONNECTED ;
114+ return link != null && link .getState () == LinkState .CONNECTED ;
119115 }
120116
121117 @ SuppressWarnings ("ConstantConditions" ) // cache is enabled
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class PauseCommand : MusicCommand() {
5353 val mng = variables.audioUtils.getMusicManager(event.guild!! .idLong)
5454 val localPlayer = mng.player
5555
56- localPlayer.ifPresentOrElse({player ->
56+ localPlayer.ifPresentOrElse({ player ->
5757 if (player.track == null ) {
5858 event.reply(" Cannot pause or resume player because no track is loaded for playing." ).queue()
5959 return @ifPresentOrElse
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ import me.duncte123.skybot.objects.RadioStream
2727import me.duncte123.skybot.objects.command.CommandContext
2828import me.duncte123.skybot.objects.command.MusicCommand
2929import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
30- import kotlin.jvm.optionals.getOrNull
3130
3231class RadioCommand : MusicCommand () {
3332 var radioStreams = arrayListOf<RadioStream >()
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEve
2727import net.dv8tion.jda.api.interactions.commands.OptionType
2828import net.dv8tion.jda.api.interactions.commands.build.OptionData
2929import net.dv8tion.jda.api.interactions.commands.build.SubcommandData
30- import kotlin.jvm.optionals.getOrNull
3130import kotlin.math.max
3231import kotlin.math.min
3332
You can’t perform that action at this time.
0 commit comments