diff --git a/src/main/java/commands/chat/WarframeAlerts.java b/src/main/java/commands/chat/WarframeAlerts.java index e15b439..5ed3ab4 100644 --- a/src/main/java/commands/chat/WarframeAlerts.java +++ b/src/main/java/commands/chat/WarframeAlerts.java @@ -148,30 +148,30 @@ public static void startTimer(JDA jda) { @Override public void run() { - ArrayList textChans = new ArrayList<>(); - jda.getGuilds().forEach(g -> { - List chans = g.getTextChannelsByName(SSSS.getWARFRAMELAERTSCHAN(g), true); - if (chans.size() > 0) - textChans.add(chans.get(0)); - }); - - textChans.forEach(chan -> { - - List history = chan.getHistory().retrievePast(1).complete(); - - if (history.size() == 0) { - try { - chan.sendMessage(createMessage(getAlerts()).build()).queue(); - } catch (IOException e) { - e.printStackTrace(); - } - } else if (history.get(0).getAuthor().equals(jda.getSelfUser())) { - try { - history.get(0).editMessage(createMessage(getAlerts()).build()).queue(); - } catch (IOException e) { - e.printStackTrace(); + ArrayList textChans = new ArrayList<>(); + jda.getGuilds().forEach(g -> { + List chans = g.getTextChannelsByName(SSSS.getWARFRAMELAERTSCHAN(g), true); + if (chans.size() > 0) + textChans.add(chans.get(0)); + }); + + textChans.forEach(chan -> { + + List history = chan.getHistory().retrievePast(1).complete(); + + if (history.size() == 0) { + try { + chan.sendMessage(createMessage(getAlerts()).build()).queue(); + } catch (Exception e) { + // e.printStackTrace(); + } + } else if (history.get(0).getAuthor().equals(jda.getSelfUser())) { + try { + history.get(0).editMessage(createMessage(getAlerts()).build()).queue(); + } catch (Exception e) { + // e.printStackTrace(); + } } - } }); diff --git a/src/main/java/commands/music/Music.java b/src/main/java/commands/music/Music.java index ad150f7..8fd392e 100644 --- a/src/main/java/commands/music/Music.java +++ b/src/main/java/commands/music/Music.java @@ -316,7 +316,7 @@ public void onTrackStart(AudioPlayer player, AudioTrack track) { Set queue = getTrackManager(guild).getQueuedTracks(); ArrayList tracks = new ArrayList<>(); - queue.forEach(audioInfo -> tracks.add(audioInfo)); + queue.forEach(tracks::add); EmbedBuilder eb = new EmbedBuilder() .setColor(Color.CYAN) diff --git a/src/main/java/core/Perms.java b/src/main/java/core/Perms.java index 4147611..8158bac 100644 --- a/src/main/java/core/Perms.java +++ b/src/main/java/core/Perms.java @@ -26,7 +26,7 @@ public static boolean isOwner(User user, TextChannel channel) { channel.sendMessage(MSGS.error().setDescription("There is no owner ID set in `SETTINGS.txt`.\nIf you are the owner of this bot, please add your Discord user id in the `SETTINGS.txt`!").build()).queue(); return false; } - if (user.getId().equals(STATICS.BOT_OWNER_ID)) + if (user.getId().equals(String.valueOf(STATICS.BOT_OWNER_ID))) return true; channel.sendMessage(MSGS.error().setDescription("Only the bots owner (" + user.getJDA().getUserById(STATICS.BOT_OWNER_ID).getAsMention() + ") can use this command.").build()).queue(); return false; diff --git a/src/main/java/utils/STATICS.java b/src/main/java/utils/STATICS.java index 8b0d865..ad9204a 100644 --- a/src/main/java/utils/STATICS.java +++ b/src/main/java/utils/STATICS.java @@ -17,7 +17,7 @@ public class STATICS { //######### GENERAL BOT SETTINGS #########// - public static String VERSION = "1.36.2.0"; + public static String VERSION = "1.36.2.1"; public static String THISBUILD = BUILDTYPE.STABLE; public static class BUILDTYPE { @@ -111,6 +111,6 @@ public class CMDTYPE { public static int MUSIC_BUFFER = 1000; - public static int SERVER_LIMIT = 1; + public static int SERVER_LIMIT = 30; }