Skip to content

Commit 22c80f5

Browse files
committed
lint code
1 parent bc91550 commit 22c80f5

File tree

4 files changed

+2
-8
lines changed

4 files changed

+2
-8
lines changed

bot/src/main/java/fredboat/audio/player/LavalinkManager.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff 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

bot/src/main/kotlin/me/duncte123/skybot/commands/music/PauseCommand.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

bot/src/main/kotlin/me/duncte123/skybot/commands/music/RadioCommand.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import me.duncte123.skybot.objects.RadioStream
2727
import me.duncte123.skybot.objects.command.CommandContext
2828
import me.duncte123.skybot.objects.command.MusicCommand
2929
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
30-
import kotlin.jvm.optionals.getOrNull
3130

3231
class RadioCommand : MusicCommand() {
3332
var radioStreams = arrayListOf<RadioStream>()

bot/src/main/kotlin/me/duncte123/skybot/commands/music/VolumeCommand.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEve
2727
import net.dv8tion.jda.api.interactions.commands.OptionType
2828
import net.dv8tion.jda.api.interactions.commands.build.OptionData
2929
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData
30-
import kotlin.jvm.optionals.getOrNull
3130
import kotlin.math.max
3231
import kotlin.math.min
3332

0 commit comments

Comments
 (0)