From 7e4f86011613e25ab5d69e3109ddd6110c4fe285 Mon Sep 17 00:00:00 2001 From: zekroTJA Date: Thu, 13 Jul 2017 11:56:15 +0200 Subject: [PATCH 1/3] fixed MSGS.error bug, fixed report bug, fixed some permissions --- .../java/commands/administration/Guilds.java | 2 +- src/main/java/commands/chat/BJoke.java | 8 +++---- src/main/java/commands/chat/Cat.java | 2 +- src/main/java/commands/chat/Clear.java | 14 ++++++------ src/main/java/commands/chat/Quote.java | 4 ++-- src/main/java/commands/chat/Vote2.java | 22 +++++++++---------- .../java/commands/chat/WarframeAlerts.java | 4 ++-- src/main/java/commands/etc/Bug.java | 4 ++-- src/main/java/commands/etc/Log.java | 6 ++--- src/main/java/commands/etc/Rand6.java | 14 ++++++------ .../commands/guildAdministration/Moveall.java | 8 +++---- .../commands/guildAdministration/Report.java | 4 ++-- .../commands/guildAdministration/Spacer.java | 4 ++-- .../guildAdministration/VoiceKick.java | 8 +++---- src/main/java/commands/music/Music.java | 18 +++++++-------- src/main/java/commands/settings/AutoRole.java | 12 +++++----- .../java/commands/settings/Botmessage.java | 2 +- src/main/java/commands/settings/PermLvls.java | 12 +++++----- src/main/java/commands/settings/Prefix.java | 8 +++---- .../commands/settings/ServerJoinMessage.java | 8 +++---- .../commands/settings/ServerLeftMessage.java | 8 +++---- src/main/java/core/Perms.java | 6 +++-- src/main/java/utils/MSGS.java | 9 ++++++-- 23 files changed, 97 insertions(+), 90 deletions(-) diff --git a/src/main/java/commands/administration/Guilds.java b/src/main/java/commands/administration/Guilds.java index b0d55fb..cadea52 100644 --- a/src/main/java/commands/administration/Guilds.java +++ b/src/main/java/commands/administration/Guilds.java @@ -36,7 +36,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept try { g = event.getJDA().getGuildById(args[1]); } catch (Exception e) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("There is no guild with the entered ID.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("There is no guild with the entered ID.").build()).queue(); return; } diff --git a/src/main/java/commands/chat/BJoke.java b/src/main/java/commands/chat/BJoke.java index 1364529..42c5455 100644 --- a/src/main/java/commands/chat/BJoke.java +++ b/src/main/java/commands/chat/BJoke.java @@ -38,12 +38,12 @@ public void action(String[] args, final MessageReceivedEvent event) { if (args[0].toLowerCase().equals("c")) { if (victim == null) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("There is currently no victim to save. :^)").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("There is currently no victim to save. :^)").build()).queue(); return; } if (event.getMember().equals(victim)) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("Sorry, " + event.getAuthor().getAsMention() + ", you can't free yourself from your fate...").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("Sorry, " + event.getAuthor().getAsMention() + ", you can't free yourself from your fate...").build()).queue(); return; } @@ -52,7 +52,7 @@ public void action(String[] args, final MessageReceivedEvent event) { countdown.cancel(); countdown = new Timer(); count = 10; - event.getTextChannel().sendMessage(MSGS.success.setDescription("You had luck, " + victim.getAsMention() + ". " + event.getAuthor().getAsMention() + " freed you from the kick.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("You had luck, " + victim.getAsMention() + ". " + event.getAuthor().getAsMention() + " freed you from the kick.").build()).queue(); victim = null; return; } @@ -60,7 +60,7 @@ public void action(String[] args, final MessageReceivedEvent event) { try { victim = event.getGuild().getMember(event.getMessage().getMentionedUsers().get(0)); } catch (Exception e) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } diff --git a/src/main/java/commands/chat/Cat.java b/src/main/java/commands/chat/Cat.java index bd6e4a0..b0dfd60 100644 --- a/src/main/java/commands/chat/Cat.java +++ b/src/main/java/commands/chat/Cat.java @@ -35,7 +35,7 @@ public void action(String[] args, MessageReceivedEvent event) { delay = Integer.parseInt(args[1]); if (delay < 5) { delay = 5; - event.getTextChannel().sendMessage(MSGS.error.setDescription("The minumum time period is 5 seconds because of spam protection. ;)").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("The minumum time period is 5 seconds because of spam protection. ;)").build()).queue(); } } catch (Exception e) { delay = 10; diff --git a/src/main/java/commands/chat/Clear.java b/src/main/java/commands/chat/Clear.java index 2dbbb85..0e49f0b 100644 --- a/src/main/java/commands/chat/Clear.java +++ b/src/main/java/commands/chat/Clear.java @@ -60,7 +60,7 @@ public void action(String[] args, MessageReceivedEvent event) { //Nichts tun } - Message answer = event.getTextChannel().sendMessage(MSGS.success.setDescription( + Message answer = event.getTextChannel().sendMessage(MSGS.success().setDescription( "Successfully deleted all messages!" ).build()).complete(); @@ -77,7 +77,7 @@ public void run() { msgs = history.retrievePast(2).complete(); msgs.get(0).delete().queue(); - Message answer = event.getTextChannel().sendMessage(MSGS.success.setDescription( + Message answer = event.getTextChannel().sendMessage(MSGS.success().setDescription( "Successfully deleted last message!" ).build()).complete(); @@ -113,7 +113,7 @@ public void run() { } - Message answer = event.getTextChannel().sendMessage(MSGS.success.setDescription( + Message answer = event.getTextChannel().sendMessage(MSGS.success().setDescription( "Successfully deleted " + args[0] + " messages!" ).build()).complete(); @@ -129,7 +129,7 @@ public void run() { } catch (ParseException ex) { - event.getTextChannel().sendMessage(MSGS.error + event.getTextChannel().sendMessage(MSGS.error() .addField("Error Type", "Wrong Timeformat.", false) .addField("Description", "Pleas enter the Time in the right Timeformat:\n" + simpleDateFormat.format(new Date()), false) .build() @@ -142,7 +142,7 @@ public void run() { msgs = history.retrievePast(getInt(args[0])).complete(); event.getTextChannel().deleteMessages(msgs).queue(); - Message answer = event.getTextChannel().sendMessage(MSGS.success.setDescription( + Message answer = event.getTextChannel().sendMessage(MSGS.success().setDescription( "Successfully deleted " + args[0] + " messages!" ).build()).complete(); @@ -153,7 +153,7 @@ public void run() { } }, 3000); } else { - event.getTextChannel().sendMessage(MSGS.error + event.getTextChannel().sendMessage(MSGS.error() .addField("Error Type", "Message value out of bounds.", false) .addField("Description", "The entered number if messages can not be more than 100 messages!", false) .build() @@ -162,7 +162,7 @@ public void run() { } catch (Exception e) { - event.getTextChannel().sendMessage(MSGS.error + event.getTextChannel().sendMessage(MSGS.error() .addField("Error Type", e.getLocalizedMessage(), false) .addField("Message", e.getMessage(), false) .build() diff --git a/src/main/java/commands/chat/Quote.java b/src/main/java/commands/chat/Quote.java index b2afa77..0a9fe9a 100644 --- a/src/main/java/commands/chat/Quote.java +++ b/src/main/java/commands/chat/Quote.java @@ -28,7 +28,7 @@ public boolean called(String[] args, MessageReceivedEvent event) { public void action(String[] args, MessageReceivedEvent event) throws ParseException, IOException { if (args.length < 1) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } @@ -44,7 +44,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept }); if (msg.size() < 1) { - chanMSG.editMessage(MSGS.error.setDescription( + chanMSG.editMessage(MSGS.error().setDescription( "There is no message in any chat on this guild with the ID `" + args[0] + "`." ).build()).queue(); return; diff --git a/src/main/java/commands/chat/Vote2.java b/src/main/java/commands/chat/Vote2.java index a7788a2..b7e0160 100644 --- a/src/main/java/commands/chat/Vote2.java +++ b/src/main/java/commands/chat/Vote2.java @@ -52,7 +52,7 @@ public Poll(Guild guild, Member creator, Message message, List content) private void createPoll(String[] args, MessageReceivedEvent event) { if (voteHash.containsKey(event.getGuild())) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("A poll is currently running! Please close that poll before opening another one!").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("A poll is currently running! Please close that poll before opening another one!").build()).queue(); return; } @@ -82,13 +82,13 @@ private void createPoll(String[] args, MessageReceivedEvent event) { private void votePoll(String[] args, MessageReceivedEvent event) { if (args.length < 2) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } else if (!voteHash.containsKey(event.getGuild())) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("There is currently no poll running to vote for!").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("There is currently no poll running to vote for!").build()).queue(); return; } else if (voteHash.get(event.getGuild()).votes.containsKey(event.getMember())) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("Sorry, " + event.getAuthor().getAsMention() + ", you can only vote **once** for a poll!").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("Sorry, " + event.getAuthor().getAsMention() + ", you can only vote **once** for a poll!").build()).queue(); return; } @@ -96,12 +96,12 @@ private void votePoll(String[] args, MessageReceivedEvent event) { try { votenumb = Integer.parseInt(args[1]); } catch (Exception e) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("Please enter a valid number as vote.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("Please enter a valid number as vote.").build()).queue(); return; } if (votenumb > voteHash.get(event.getGuild()).content.stream().skip(1).count()) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("Please enter a valid number as vote.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("Please enter a valid number as vote.").build()).queue(); return; } @@ -114,7 +114,7 @@ private void votePoll(String[] args, MessageReceivedEvent event) { private void statsPoll(MessageReceivedEvent event) { if (!voteHash.containsKey(event.getGuild())) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("There is currently no poll running!").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("There is currently no poll running!").build()).queue(); return; } @@ -137,7 +137,7 @@ private void statsPoll(MessageReceivedEvent event) { private void closePoll(MessageReceivedEvent event) { if (!voteHash.containsKey(event.getGuild())) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("There is currently no poll running to vote for!").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("There is currently no poll running to vote for!").build()).queue(); return; } @@ -146,7 +146,7 @@ private void closePoll(MessageReceivedEvent event) { voteHash.remove(event.getGuild()); event.getTextChannel().sendMessage(new EmbedBuilder().setColor(new Color(0xFF5600)).setDescription("Vote closed by " + event.getMember().getAsMention() + ".").build()).queue(); } else { - event.getTextChannel().sendMessage(MSGS.error.setDescription("Sorry, " + event.getMember().getAsMention() + ", only the creator of the poll or a member with at least permission level 1 can close a running poll.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("Sorry, " + event.getMember().getAsMention() + ", only the creator of the poll or a member with at least permission level 1 can close a running poll.").build()).queue(); } } @@ -161,7 +161,7 @@ public boolean called(String[] args, MessageReceivedEvent event) { public void action(String[] args, MessageReceivedEvent event) throws ParseException, IOException { if (args.length < 1) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); } switch (args[0]) { @@ -188,7 +188,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept break; default: - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); } } diff --git a/src/main/java/commands/chat/WarframeAlerts.java b/src/main/java/commands/chat/WarframeAlerts.java index 2f75458..d7794a5 100644 --- a/src/main/java/commands/chat/WarframeAlerts.java +++ b/src/main/java/commands/chat/WarframeAlerts.java @@ -223,12 +223,12 @@ public void run() { case "channel": if (args.length < 2) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("Please enter a valid text channel!").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("Please enter a valid text channel!").build()).queue(); return; } SSSS.setWARFRAMELAERTSCHAN(args[1].toLowerCase(), event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Successfully set warframe alerts channel to `" + args[1].toLowerCase() + "`").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Successfully set warframe alerts channel to `" + args[1].toLowerCase() + "`").build()).queue(); } } diff --git a/src/main/java/commands/etc/Bug.java b/src/main/java/commands/etc/Bug.java index 7e45ac2..4568ec5 100644 --- a/src/main/java/commands/etc/Bug.java +++ b/src/main/java/commands/etc/Bug.java @@ -34,7 +34,7 @@ public class Bug implements Command { public static void sendConfMessage() { - MESSAGE.getTextChannel().sendMessage(MSGS.success.setDescription("Submit sucesfully send!").build()).queue(); + MESSAGE.getTextChannel().sendMessage(MSGS.success().setDescription("Submit sucesfully send!").build()).queue(); } @@ -58,7 +58,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept ).build()).queue(); return; } - event.getTextChannel().sendMessage(MSGS.error.setDescription( + event.getTextChannel().sendMessage(MSGS.error().setDescription( "Sorry, the expandet version of this command is only available on the public version of the bot!\n\n" + "If you want to submit a bug or a suggestion, please use the public **[google sheet](https://s.zekro.de/botsubs)**." ).build()).queue(); diff --git a/src/main/java/commands/etc/Log.java b/src/main/java/commands/etc/Log.java index c6fd2fd..59913e1 100644 --- a/src/main/java/commands/etc/Log.java +++ b/src/main/java/commands/etc/Log.java @@ -72,9 +72,9 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept if (f.exists()) { if (f.delete()) { f.createNewFile(); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Successfully cleared log file.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Successfully cleared log file.").build()).queue(); } else { - event.getTextChannel().sendMessage(MSGS.error.setDescription("Failed while attempting to clear log file.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("Failed while attempting to clear log file.").build()).queue(); } } return; @@ -114,7 +114,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept } else { - event.getTextChannel().sendMessage(MSGS.error.setDescription("There is no file `'screenlog.0'` available to get log from.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("There is no file `'screenlog.0'` available to get log from.").build()).queue(); } diff --git a/src/main/java/commands/etc/Rand6.java b/src/main/java/commands/etc/Rand6.java index fdefd6b..9e3d66d 100644 --- a/src/main/java/commands/etc/Rand6.java +++ b/src/main/java/commands/etc/Rand6.java @@ -69,7 +69,7 @@ private void reroll(Member member, MessageReceivedEvent event) throws IOExceptio fw.write(m.getUser().getId() + ":" + rollMap.get(m) + "\n"); } catch (IOException e) { e.printStackTrace(); - event.getTextChannel().sendMessage(MSGS.error.setDescription("AN ERROR OCCURED WHILE WRITING SAVE FILE...").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("AN ERROR OCCURED WHILE WRITING SAVE FILE...").build()).queue(); } }); @@ -97,12 +97,12 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept } if (args.length < 1) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } if (!event.getMember().getVoiceState().inVoiceChannel()) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("You need to be in a voice channel to use this command!").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("You need to be in a voice channel to use this command!").build()).queue(); return; } @@ -135,7 +135,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept case "reroll": case "re": if (args.length < 2) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } reroll(event.getGuild().getMember(event.getMessage().getMentionedUsers().get(0)), event); @@ -144,9 +144,9 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept case "setops": if (args.length > 1) { SSSS.setR6OPSID(args[1], event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Successfully set Ops source URL to `" + args[1] + "`.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Successfully set Ops source URL to `" + args[1] + "`.").build()).queue(); } else { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); } return; @@ -183,7 +183,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept return; default: - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } diff --git a/src/main/java/commands/guildAdministration/Moveall.java b/src/main/java/commands/guildAdministration/Moveall.java index 63bb698..8e752a3 100644 --- a/src/main/java/commands/guildAdministration/Moveall.java +++ b/src/main/java/commands/guildAdministration/Moveall.java @@ -66,21 +66,21 @@ public void run() { } else { event.getTextChannel().sendMessage( - MSGS.error.setDescription("You don't need to move everyone in the same channel you are still in...").build() + MSGS.error().setDescription("You don't need to move everyone in the same channel you are still in...").build() ).queue(); } } else event.getTextChannel().sendMessage( - MSGS.error.setDescription("You need to be in a voice channel to use this command!").build() + MSGS.error().setDescription("You need to be in a voice channel to use this command!").build() ).queue(); } catch (NoSuchElementException e) { event.getTextChannel().sendMessage( - MSGS.error.setDescription("Please enter a valid voice channel existing on this guild!").build() + MSGS.error().setDescription("Please enter a valid voice channel existing on this guild!").build() ).queue(); } catch (Exception e) { event.getTextChannel().sendMessage( - MSGS.error + MSGS.error() .addField("Error Message", e.getMessage(), false) .build() ).queue(); diff --git a/src/main/java/commands/guildAdministration/Report.java b/src/main/java/commands/guildAdministration/Report.java index 5a1f277..a87a235 100644 --- a/src/main/java/commands/guildAdministration/Report.java +++ b/src/main/java/commands/guildAdministration/Report.java @@ -50,14 +50,14 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept new EmbedBuilder() .setAuthor(m.getEffectiveName() + " submitted a report.", null, m.getUser().getAvatarUrl()) .addField("Author", author.getEffectiveName() + " (" + author.getAsMention() + ")", true) - .addField("Reported Member", traitor.getEffectiveAvatarUrl() + " (" + traitor.getAsMention() + ")", true) + .addField("Reported Member", traitor.getName() + " (" + traitor.getAsMention() + ")", true) .addField("Reason", reason, false) .build() ).queue()); author.getUser().openPrivateChannel().complete().sendMessage( new EmbedBuilder() - .setDescription("Thanks for your report submit.\nYour report got send by direct message to " + sendTo.substring(2) + ".") + .setDescription("Thanks for your report submit.\nYour report got send by direct message to " + sendTo.toString() + ".") .build() ).queue(); diff --git a/src/main/java/commands/guildAdministration/Spacer.java b/src/main/java/commands/guildAdministration/Spacer.java index f9414be..feb917e 100644 --- a/src/main/java/commands/guildAdministration/Spacer.java +++ b/src/main/java/commands/guildAdministration/Spacer.java @@ -31,7 +31,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept if (core.Perms.check(1, event)) return; if (args.length < 1) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } @@ -40,7 +40,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept case "add": if (!event.getMember().getVoiceState().inVoiceChannel()) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("You need to be in a voice channel to add a spacer.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("You need to be in a voice channel to add a spacer.").build()).queue(); return; } diff --git a/src/main/java/commands/guildAdministration/VoiceKick.java b/src/main/java/commands/guildAdministration/VoiceKick.java index 912fd85..41774e7 100644 --- a/src/main/java/commands/guildAdministration/VoiceKick.java +++ b/src/main/java/commands/guildAdministration/VoiceKick.java @@ -43,15 +43,15 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept String vc = sb.toString().substring(1); if (event.getGuild().getVoiceChannelsByName(vc, true).size() > 0) { SSSS.setVKICKCHANNEL(vc, event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Successfully set voice kick channel to `" + vc + "`").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Successfully set voice kick channel to `" + vc + "`").build()).queue(); return; } else { - event.getTextChannel().sendMessage(MSGS.error.setDescription("Please enter a valid voice channel existing on this guild.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("Please enter a valid voice channel existing on this guild.").build()).queue(); return; } } else { - event.getTextChannel().sendMessage(MSGS.error.setDescription("Please enter a valid voice channel existing on this guild.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("Please enter a valid voice channel existing on this guild.").build()).queue(); return; } } @@ -70,7 +70,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept List vc = event.getGuild().getVoiceChannelsByName(SSSS.getVKICKCHANNEL(event.getGuild()), true); if (vc.size() == 0) { - event.getTextChannel().sendMessage(MSGS.error.setDescription("There is no voice channel set or it is no more existent on this guild.\nPlease set a valid voice channel with `-vkick channel `.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("There is no voice channel set or it is no more existent on this guild.\nPlease set a valid voice channel with `-vkick channel `.").build()).queue(); return; } diff --git a/src/main/java/commands/music/Music.java b/src/main/java/commands/music/Music.java index 30b6f04..ad150f7 100644 --- a/src/main/java/commands/music/Music.java +++ b/src/main/java/commands/music/Music.java @@ -335,7 +335,7 @@ public void onTrackEnd(AudioPlayer player, AudioTrack track, AudioTrackEndReason if (getTrackManager(guild).getQueuedTracks().size() < 2 && endlessMode) { endlessList.forEach(t -> getTrackManager(guild).queue(t, endlessAuthor)); if (guild.getTextChannelsByName(SSSS.getMUSICCHANNEL(guild), true).size() > 0) - guild.getTextChannelsByName(SSSS.getMUSICCHANNEL(guild), true).get(0).sendMessage(MSGS.success.setDescription("Repeated queue. *(endless mode)*").build()).queue(); + guild.getTextChannelsByName(SSSS.getMUSICCHANNEL(guild), true).get(0).sendMessage(MSGS.success().setDescription("Repeated queue. *(endless mode)*").build()).queue(); } new Timer().schedule(new TimerTask() { @@ -366,6 +366,8 @@ public boolean called(String[] args, MessageReceivedEvent event) { @Override public void action(String[] args, MessageReceivedEvent event) throws ParseException, IOException { + guild = event.getGuild(); + if (SSSS.getLOCKMUSICCHANNEL(guild) && !event.getTextChannel().getName().equals(SSSS.getMUSICCHANNEL(guild))) { Message msg = event.getTextChannel().sendMessage(new EmbedBuilder().setColor(Color.red).setDescription(":warning: " + event.getAuthor().getAsMention() + ", please only send music commands in the #" + STATICS.musicChannel + " channel!").build()).complete(); new Timer().schedule(new TimerTask() { @@ -378,8 +380,6 @@ public void run() { return; } - guild = event.getGuild(); - EmbedBuilder eb = new EmbedBuilder(); getPlayer(guild).removeListener(audioEventListener); @@ -404,25 +404,25 @@ public void run() { case "channel": if (core.Perms.check(2, event)) return; if (args.length < 2) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } SSSS.setMUSICCHANNEL(args[1].toLowerCase(), guild); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Music channel successfully changed to `" + args[1].toLowerCase() + "`.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Music channel successfully changed to `" + args[1].toLowerCase() + "`.").build()).queue(); break; case "lockchannel": if (core.Perms.check(2, event)) return; if (args.length < 2) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } try { SSSS.setLOCKMUSICCHANNEL(Boolean.parseBoolean(args[1]), guild); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Music channel lock successfully set to `" + Boolean.parseBoolean(args[1]) + "`.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Music channel lock successfully set to `" + Boolean.parseBoolean(args[1]) + "`.").build()).queue(); } catch (Exception e) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); } break; @@ -515,7 +515,7 @@ public void run() { endlessMode = true; endlessAuthor = event.getMember(); - event.getTextChannel().sendMessage(MSGS.success.setDescription(":repeat: Endless mode activated.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription(":repeat: Endless mode activated.").build()).queue(); break; diff --git a/src/main/java/commands/settings/AutoRole.java b/src/main/java/commands/settings/AutoRole.java index 13621f8..f53d4e4 100644 --- a/src/main/java/commands/settings/AutoRole.java +++ b/src/main/java/commands/settings/AutoRole.java @@ -27,10 +27,10 @@ public boolean called(String[] args, MessageReceivedEvent event) { @Override public void action(String[] args, MessageReceivedEvent event) throws ParseException, IOException { - if (core.Perms.check(2, event)) return; + if (core.Perms.check(permission(), event)) return; if (args.length < 1) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } @@ -40,13 +40,13 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept if (event.getMessage().getMentionedRoles().size() > 0) { SSSS.setAUTOROLE(event.getMessage().getMentionedRoles().get(0).getName(), event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Successfully set autorole to `" + event.getMessage().getMentionedRoles().get(0).getName() + "`.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Successfully set autorole to `" + event.getMessage().getMentionedRoles().get(0).getName() + "`.").build()).queue(); } else if (autoRole.size() > 0) { SSSS.setAUTOROLE(autoRole.get(0).getName(), event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Successfully set autorole to `" + autoRole.get(0).getName() + "`.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Successfully set autorole to `" + autoRole.get(0).getName() + "`.").build()).queue(); } else { SSSS.setAUTOROLE("", event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Successfully deactivated autorole.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Successfully deactivated autorole.").build()).queue(); } } @@ -73,6 +73,6 @@ public String commandType() { @Override public int permission() { - return 2; + return 3; } } diff --git a/src/main/java/commands/settings/Botmessage.java b/src/main/java/commands/settings/Botmessage.java index f42d94f..c9a9533 100644 --- a/src/main/java/commands/settings/Botmessage.java +++ b/src/main/java/commands/settings/Botmessage.java @@ -82,6 +82,6 @@ public String commandType() { @Override public int permission() { - return 2; + return 3; } } diff --git a/src/main/java/commands/settings/PermLvls.java b/src/main/java/commands/settings/PermLvls.java index c06a8f2..733859d 100644 --- a/src/main/java/commands/settings/PermLvls.java +++ b/src/main/java/commands/settings/PermLvls.java @@ -26,10 +26,10 @@ public boolean called(String[] args, MessageReceivedEvent event) { @Override public void action(String[] args, MessageReceivedEvent event) throws ParseException, IOException { - if (core.Perms.check(2, event)) return; + if (core.Perms.check(permission(), event)) return; if (args.length < 2) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } @@ -40,16 +40,16 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept case "1": SSSS.setPERMROLES_1(sb.toString().substring(0, sb.toString().length() - 1), event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Successfully set roles `" + sb.toString().substring(0, sb.toString().length() - 1) + "` to permission level `" + args[0] + "`").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Successfully set roles `" + sb.toString().substring(0, sb.toString().length() - 1) + "` to permission level `" + args[0] + "`").build()).queue(); break; case "2": SSSS.setPERMROLES_2(sb.toString().substring(0, sb.toString().length() - 1), event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Successfully set roles `" + sb.toString().substring(0, sb.toString().length() - 1) + "` to permission level `" + args[0] + "`").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Successfully set roles `" + sb.toString().substring(0, sb.toString().length() - 1) + "` to permission level `" + args[0] + "`").build()).queue(); break; default: - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); break; } @@ -78,6 +78,6 @@ public String commandType() { @Override public int permission() { - return 2; + return 3; } } diff --git a/src/main/java/commands/settings/Prefix.java b/src/main/java/commands/settings/Prefix.java index 0ee0e48..5f3f1dc 100644 --- a/src/main/java/commands/settings/Prefix.java +++ b/src/main/java/commands/settings/Prefix.java @@ -25,15 +25,15 @@ public boolean called(String[] args, MessageReceivedEvent event) { @Override public void action(String[] args, MessageReceivedEvent event) throws ParseException, IOException { - if (core.Perms.check(2, event)) return; + if (core.Perms.check(permission(), event)) return; if (args.length < 1) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(":warning: Please enter a valid prefix!").build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(":warning: Please enter a valid prefix!").build()).queue(); return; } SSSS.setPREFIX(args[0], event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Prefix successfully changed to `" + args[0] + "`.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Prefix successfully changed to `" + args[0] + "`.").build()).queue(); } @Override @@ -58,6 +58,6 @@ public String commandType() { @Override public int permission() { - return 2; + return 3; } } diff --git a/src/main/java/commands/settings/ServerJoinMessage.java b/src/main/java/commands/settings/ServerJoinMessage.java index af0c435..efca01f 100644 --- a/src/main/java/commands/settings/ServerJoinMessage.java +++ b/src/main/java/commands/settings/ServerJoinMessage.java @@ -24,10 +24,10 @@ public boolean called(String[] args, MessageReceivedEvent event) { @Override public void action(String[] args, MessageReceivedEvent event) throws ParseException, IOException { - if (core.Perms.check(2, event)) return; + if (core.Perms.check(permission(), event)) return; if (args.length < 1) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } @@ -35,7 +35,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept Arrays.stream(args).forEach(s -> sb.append(s + " ")); SSSS.setSERVERJOINMESSAGE(sb.toString().substring(0, sb.toString().length() - 1), event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Server join message successfully changed to `" + sb.toString().substring(0, sb.toString().length() - 1) + "`.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Server join message successfully changed to `" + sb.toString().substring(0, sb.toString().length() - 1) + "`.").build()).queue(); } @Override @@ -62,6 +62,6 @@ public String commandType() { @Override public int permission() { - return 2; + return 3; } } diff --git a/src/main/java/commands/settings/ServerLeftMessage.java b/src/main/java/commands/settings/ServerLeftMessage.java index e7259a4..3d42612 100644 --- a/src/main/java/commands/settings/ServerLeftMessage.java +++ b/src/main/java/commands/settings/ServerLeftMessage.java @@ -25,10 +25,10 @@ public boolean called(String[] args, MessageReceivedEvent event) { @Override public void action(String[] args, MessageReceivedEvent event) throws ParseException, IOException { - if (core.Perms.check(2, event)) return; + if (core.Perms.check(permission(), event)) return; if (args.length < 1) { - event.getTextChannel().sendMessage(MSGS.error.setDescription(help()).build()).queue(); + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; } @@ -36,7 +36,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept Arrays.stream(args).forEach(s -> sb.append(s + " ")); SSSS.setSERVERLEAVEMESSAGE(sb.toString().substring(0, sb.toString().length() - 1), event.getGuild()); - event.getTextChannel().sendMessage(MSGS.success.setDescription("Server leave message successfully changed to `" + sb.toString().substring(0, sb.toString().length() - 1) + "`.").build()).queue(); + event.getTextChannel().sendMessage(MSGS.success().setDescription("Server leave message successfully changed to `" + sb.toString().substring(0, sb.toString().length() - 1) + "`.").build()).queue(); } @Override @@ -63,6 +63,6 @@ public String commandType() { @Override public int permission() { - return 2; + return 3; } } diff --git a/src/main/java/core/Perms.java b/src/main/java/core/Perms.java index 9ff839c..8ce558d 100644 --- a/src/main/java/core/Perms.java +++ b/src/main/java/core/Perms.java @@ -23,18 +23,20 @@ public class Perms { public static boolean isOwner(User user, TextChannel channel) { if (STATICS.BOT_OWNER_ID.equals("")) { - 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(); + 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)) 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(); + 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; } public static int getLvl(Member member) { + if (member.equals(member.getGuild().getOwner())) + return 3; if (member.getRoles().stream().anyMatch(role -> Arrays.stream(SSSS.getPERMROLES_2(member.getGuild())).anyMatch(s1 -> role.getName().equals(s1)))) { return 2; } else if (member.getRoles().stream().anyMatch(role -> Arrays.stream(SSSS.getPERMROLES_1(member.getGuild())).anyMatch(s -> role.getName().equals(s)))) { diff --git a/src/main/java/utils/MSGS.java b/src/main/java/utils/MSGS.java index 49fe66e..ccf1319 100644 --- a/src/main/java/utils/MSGS.java +++ b/src/main/java/utils/MSGS.java @@ -12,7 +12,12 @@ public class MSGS { - public static EmbedBuilder success = new EmbedBuilder().setColor(Color.green); - public static EmbedBuilder error = new EmbedBuilder().setColor(Color.red).setDescription(":warning: **Can not run command because an error occurred.**"); + public static EmbedBuilder success() { + return new EmbedBuilder().setColor(Color.green); + } + + public static EmbedBuilder error() { + return new EmbedBuilder().setColor(Color.red); + } } From 001f9142004c287112e5aa1ed88826add02978f0 Mon Sep 17 00:00:00 2001 From: zekroTJA Date: Thu, 13 Jul 2017 13:19:30 +0200 Subject: [PATCH 2/3] updated rand6, fixed quote help --- src/main/java/commands/chat/Quote.java | 2 +- src/main/java/commands/essentials/Help.java | 2 +- src/main/java/commands/etc/Rand6.java | 82 ++++++++++++++++++--- src/main/java/core/Main.java | 1 + src/main/java/utils/STATICS.java | 2 +- 5 files changed, 77 insertions(+), 12 deletions(-) diff --git a/src/main/java/commands/chat/Quote.java b/src/main/java/commands/chat/Quote.java index 0a9fe9a..ba12054 100644 --- a/src/main/java/commands/chat/Quote.java +++ b/src/main/java/commands/chat/Quote.java @@ -74,7 +74,7 @@ public void executed(boolean success, MessageReceivedEvent event) { @Override public String help() { - return null; + return "**USAGE:** `-quote `"; } @Override diff --git a/src/main/java/commands/essentials/Help.java b/src/main/java/commands/essentials/Help.java index 1e73ab3..fda7248 100644 --- a/src/main/java/commands/essentials/Help.java +++ b/src/main/java/commands/essentials/Help.java @@ -66,7 +66,7 @@ public void action(String[] args, MessageReceivedEvent event) { StringBuilder ciams = new StringBuilder(); - String[] ignorers = {"test", "c", "bj", "ttt", "userinfo", "dev", "nudge", "poll", "moveall", "purge", "info", "suggestion", "r6", }; + String[] ignorers = {"test", "r", "c", "bj", "ttt", "userinfo", "dev", "nudge", "poll", "moveall", "purge", "info", "suggestion", "r6", }; Arrays.stream(ignorers).forEach(s -> cmds.remove(s)); diff --git a/src/main/java/commands/etc/Rand6.java b/src/main/java/commands/etc/Rand6.java index 9e3d66d..8b193d5 100644 --- a/src/main/java/commands/etc/Rand6.java +++ b/src/main/java/commands/etc/Rand6.java @@ -14,6 +14,7 @@ import java.text.ParseException; import java.util.*; import java.util.List; +import java.util.concurrent.TimeUnit; /** * Created by zekro on 06.06.2017 / 10:52 @@ -55,11 +56,11 @@ private void reroll(Member member, MessageReceivedEvent event) throws IOExceptio } if ((date.getTime()) < Long.parseLong((rollMap.get(member) == null) ? (date.getTime()-1) + "" : rollMap.get(member))) { - event.getTextChannel().sendMessage(new EmbedBuilder().setColor(Color.red).setDescription("Your reroll is still consumed.").build()).queue(); + event.getTextChannel().sendMessage(new EmbedBuilder().setColor(Color.red).setDescription("Your reroll is still consumed.\nReset in `" + timeToReset(rollMap.get(member)) + "`.").build()).queue(); return; } else { - rollMap.put(member, (date.getTime() + 24*60*60*1000) + ""); - event.getTextChannel().sendMessage(new EmbedBuilder().setColor(Color.orange).setDescription(member.getAsMention() + " USED A REROLL.\n\nYour new operator, " + member.getAsMention() + ", is `" + getRandOp() + "`").build()).queue(); + rollMap.put(member, (date.getTime() + 12*60*60*1000) + ""); + event.getTextChannel().sendMessage(new EmbedBuilder().setColor(Color.orange).setDescription(member.getAsMention() + " USED A REROLL. (Reset in `" + timeToReset(rollMap.get(member)) + "`)\n\nYour new operator, " + member.getAsMention() + ", is `" + getRandOp() + "`").build()).queue(); } FileWriter fw = new FileWriter(saveFile); @@ -77,6 +78,47 @@ private void reroll(Member member, MessageReceivedEvent event) throws IOExceptio } + private void resetReroll(Member member, MessageReceivedEvent event) throws IOException { + + BufferedReader fr; + Date date = new Date(); + + HashMap rollMap = new HashMap<>(); + + if (saveFile.exists()) { + fr = new BufferedReader(new FileReader(saveFile)); + fr.lines().forEach(s -> rollMap.put(event.getGuild().getMemberById(s.split(":")[0]), s.split(":")[1])); + fr.close(); + } + + if (rollMap.containsKey(member)) { + rollMap.remove(member); + + FileWriter fw = new FileWriter(saveFile); + + rollMap.keySet().stream().forEach(m -> { + try { + fw.write(m.getUser().getId() + ":" + rollMap.get(m) + "\n"); + } catch (IOException e) { + e.printStackTrace(); + event.getTextChannel().sendMessage(MSGS.error().setDescription("AN ERROR OCCURED WHILE WRITING SAVE FILE...").build()).queue(); + } + }); + + event.getTextChannel().sendMessage(new EmbedBuilder().setColor(Color.cyan).setDescription("**Reseted reroll from " + member.getAsMention() + "**").build()).queue(); + } else + event.getTextChannel().sendMessage(MSGS.error().setDescription(member.getAsMention() + " has no active reroll timeouts.").build()).queue(); + + } + + private String timeToReset(String reset) { + Date date = new Date(); + long timetoreset = Long.parseLong(reset) - date.getTime(); + return String.format("%d h, %d m", + TimeUnit.MILLISECONDS.toHours(timetoreset), + TimeUnit.MILLISECONDS.toMinutes(timetoreset) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(timetoreset))); + } + @Override public boolean called(String[] args, MessageReceivedEvent event) { @@ -135,7 +177,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept case "reroll": case "re": if (args.length < 2) { - event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); + reroll(event.getMember(), event); return; } reroll(event.getGuild().getMember(event.getMessage().getMentionedUsers().get(0)), event); @@ -176,12 +218,32 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept case "rerolls": case "rlist": if (saveFile.exists()) { - StringBuilder rollist = new StringBuilder(); - BufferedReader br = new BufferedReader(new FileReader(saveFile)); - br.lines().forEach(s -> rollist.append(event.getGuild().getMemberById(s.split(":")[0]))); + HashMap rollMap = new HashMap<>(); + StringBuilder outStr = new StringBuilder(); + if (saveFile.exists()) { + BufferedReader fr = new BufferedReader(new FileReader(saveFile)); + fr.lines().forEach(s -> rollMap.put(event.getGuild().getMemberById(s.split(":")[0]), s.split(":")[1])); + fr.close(); + rollMap.keySet().forEach(k -> + outStr.append("**" + k.getEffectiveName() + "** - *expires:* `" + timeToReset(rollMap.get(k)) + "`\n") + ); + event.getTextChannel().sendMessage(new EmbedBuilder().setDescription("**USED REROLLS:**\n\n" + outStr.toString()).build()).queue(); + } + } + return; + + case "reset": + if (args.length < 2) { + event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); + return; } + if (core.Perms.check(2, event)) return; + + resetReroll(event.getGuild().getMember(event.getMessage().getMentionedUsers().get(0)), event); + return; + default: event.getTextChannel().sendMessage(MSGS.error().setDescription(help()).build()).queue(); return; @@ -209,10 +271,12 @@ public void executed(boolean success, MessageReceivedEvent event) { @Override public String help() { return "USAGE:\n" + - "**rand6 rules** - `Display RANDOM6SIEGEĀ© game rules`" + + "**rand6 rules** - `Display RANDOM6SIEGEĀ© game rules`\n" + "**rand6 d** - `Get random ops for defenders side`\n" + "**rand6 a** - `Get random ops for attackers side`\n" + - "**rand6 r <@mention>** - `Use a reroll - Reusable after 24 hours`\n" + + "**rand6 r (<@mention>)** - `Use a reroll`\n" + + "**rand6 list** - `List all outtiming rerolls`\n" + + "**rand6 reset <@mention>** - `Reset an outtiming reroll`\n" + "**rand6 setops ** - `Set URL for a online text file with operators list for randomizing - set to OFF for default list`\n" + "**rand6 listops** - `Get current operators lists`"; } diff --git a/src/main/java/core/Main.java b/src/main/java/core/Main.java index cbab816..98b02af 100644 --- a/src/main/java/core/Main.java +++ b/src/main/java/core/Main.java @@ -130,6 +130,7 @@ public static void initializeCommands() { commands.put("quote", new Quote()); commands.put("r6", new Rand6()); commands.put("rand6", new Rand6()); + commands.put("r", new Rand6()); commands.put("mute", new Mute()); commands.put("log", new Log()); commands.put("broadcast", new Broadcast()); diff --git a/src/main/java/utils/STATICS.java b/src/main/java/utils/STATICS.java index 0e708ed..a94fad0 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.32.0.0"; + public static String VERSION = "1.32.1.0"; public static String THISBUILD = BUILDTYPE.STABLE; public static class BUILDTYPE { From c50bcdd2d22a713530678ba3bc204caaef31856c Mon Sep 17 00:00:00 2001 From: zekroTJA Date: Thu, 13 Jul 2017 13:21:49 +0200 Subject: [PATCH 3/3] updated version --- src/main/java/utils/STATICS.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/utils/STATICS.java b/src/main/java/utils/STATICS.java index a94fad0..4614103 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.32.1.0"; + public static String VERSION = "1.32.2.0"; public static String THISBUILD = BUILDTYPE.STABLE; public static class BUILDTYPE {