Skip to content

Commit

Permalink
lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Feb 8, 2024
1 parent bc91550 commit 22c80f5
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions bot/src/main/java/fredboat/audio/player/LavalinkManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ public boolean isConnected(long guildId) {

final var link = lavalink.getLinkIfCached(guildId);

if (link == null) {
return false;
}

return link.getState() == LinkState.CONNECTED;
return link != null && link.getState() == LinkState.CONNECTED;
}

@SuppressWarnings("ConstantConditions") // cache is enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PauseCommand : MusicCommand() {
val mng = variables.audioUtils.getMusicManager(event.guild!!.idLong)
val localPlayer = mng.player

localPlayer.ifPresentOrElse({player ->
localPlayer.ifPresentOrElse({ player ->
if (player.track == null) {
event.reply("Cannot pause or resume player because no track is loaded for playing.").queue()
return@ifPresentOrElse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import me.duncte123.skybot.objects.RadioStream
import me.duncte123.skybot.objects.command.CommandContext
import me.duncte123.skybot.objects.command.MusicCommand
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
import kotlin.jvm.optionals.getOrNull

class RadioCommand : MusicCommand() {
var radioStreams = arrayListOf<RadioStream>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEve
import net.dv8tion.jda.api.interactions.commands.OptionType
import net.dv8tion.jda.api.interactions.commands.build.OptionData
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData
import kotlin.jvm.optionals.getOrNull
import kotlin.math.max
import kotlin.math.min

Expand Down

0 comments on commit 22c80f5

Please sign in to comment.