Skip to content

Commit

Permalink
Fix warnings and deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
t3rminus committed Apr 1, 2022
1 parent c404e92 commit 8457f94
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/jagrosh/jmusicbot/BotConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import net.dv8tion.jda.api.OnlineStatus;
import net.dv8tion.jda.api.entities.Activity;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/jagrosh/jmusicbot/audio/AudioHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public Message getNowPlaying(JDA jda)
+ " `[" + FormatUtil.formatTime(track.getPosition()) + "/" + FormatUtil.formatTime(track.getDuration()) + "]` "
+ FormatUtil.volumeIcon(audioPlayer.getVolume()));

return mb.setEmbed(eb.build()).build();
return mb.setEmbeds(eb.build()).build();
}
else return null;
}
Expand All @@ -248,7 +248,7 @@ public Message getNoMusicPlaying(JDA jda)
Guild guild = guild(jda);
return new MessageBuilder()
.setContent(FormatUtil.filter(manager.getBot().getConfig().getSuccess()+" **Now Playing...**"))
.setEmbed(new EmbedBuilder()
.setEmbeds(new EmbedBuilder()
.setTitle("No music playing")
.setDescription(JMusicBot.STOP_EMOJI+" "+FormatUtil.progressBar(-1)+" "+FormatUtil.volumeIcon(audioPlayer.getVolume()))
.setColor(guild.getSelfMember().getColor())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager;
import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers;
import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager;
import com.typesafe.config.Config;
import net.dv8tion.jda.api.entities.Guild;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.jagrosh.jmusicbot.audio.AudioHandler;
import com.jagrosh.jmusicbot.audio.RequestMetadata;
import com.jagrosh.jmusicbot.commands.DJCommand;
import net.dv8tion.jda.api.entities.User;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected void execute(CommandEvent event)
.setFooter(event.getJDA().getGuilds().size() + " servers | "
+ event.getJDA().getGuilds().stream().filter(g -> g.getSelfMember().getVoiceState().inVoiceChannel()).count()
+ " audio connections", null);
event.getChannel().sendMessage(builder.setEmbed(ebuilder.build()).build()).queue();
event.getChannel().sendMessage(builder.setEmbeds(ebuilder.build()).build()).queue();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void doCommand(CommandEvent event)
Message nonowp = ah.getNoMusicPlaying(event.getJDA());
Message built = new MessageBuilder()
.setContent(event.getClient().getWarning() + " There is no music in the queue!")
.setEmbed((nowp==null ? nonowp : nowp).getEmbeds().get(0)).build();
.setEmbeds((nowp==null ? nonowp : nowp).getEmbeds().get(0)).build();
event.reply(built, m ->
{
if(nowp!=null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.jagrosh.jmusicbot.audio.AudioHandler;
import com.jagrosh.jmusicbot.audio.RequestMetadata;
import com.jagrosh.jmusicbot.commands.MusicCommand;
import net.dv8tion.jda.api.entities.User;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public List<String> getPlaylistNames()
else
{
createFolder();
return Collections.EMPTY_LIST;
return Collections.emptyList();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jagrosh/jmusicbot/settings/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public double getSkipRatio()
@Override
public Collection<String> getPrefixes()
{
return prefix == null ? Collections.EMPTY_SET : Collections.singleton(prefix);
return prefix == null ? Collections.emptySet() : Collections.singleton(prefix);
}

// Setters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
* @author John Grosh ([email protected])
*/
public class SettingsManager implements GuildSettingsManager
public class SettingsManager implements GuildSettingsManager<Settings>
{
private final static double SKIP_RATIO = .55;
private final HashMap<Long,Settings> settings;
Expand Down

0 comments on commit 8457f94

Please sign in to comment.