Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ゼクロ committed Aug 20, 2017
1 parent b0db553 commit d8ccbff
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
46 changes: 23 additions & 23 deletions src/main/java/commands/chat/WarframeAlerts.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,30 +148,30 @@ public static void startTimer(JDA jda) {
@Override
public void run() {

ArrayList<TextChannel> textChans = new ArrayList<>();
jda.getGuilds().forEach(g -> {
List<TextChannel> chans = g.getTextChannelsByName(SSSS.getWARFRAMELAERTSCHAN(g), true);
if (chans.size() > 0)
textChans.add(chans.get(0));
});

textChans.forEach(chan -> {

List<Message> 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<TextChannel> textChans = new ArrayList<>();
jda.getGuilds().forEach(g -> {
List<TextChannel> chans = g.getTextChannelsByName(SSSS.getWARFRAMELAERTSCHAN(g), true);
if (chans.size() > 0)
textChans.add(chans.get(0));
});

textChans.forEach(chan -> {

List<Message> 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();
}
}
}

});

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/commands/music/Music.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public void onTrackStart(AudioPlayer player, AudioTrack track) {

Set<AudioInfo> queue = getTrackManager(guild).getQueuedTracks();
ArrayList<AudioInfo> tracks = new ArrayList<>();
queue.forEach(audioInfo -> tracks.add(audioInfo));
queue.forEach(tracks::add);

EmbedBuilder eb = new EmbedBuilder()
.setColor(Color.CYAN)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/core/Perms.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/utils/STATICS.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

}

0 comments on commit d8ccbff

Please sign in to comment.