Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
Fixed some bugs that caused minor errors in the beta phase
  • Loading branch information
Gregor7008 committed Mar 13, 2022
1 parent 566c95a commit b03e7e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/base/Bot.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private void readConsole() {
try {
Writer output = new BufferedWriter(new FileWriter(environment + "/configs/bugs.txt", true));
String[] bug = line.split(" ", 2);
output.append(bug[1]);
output.append(bug[1] + "\n");
output.close();
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Invalid arguments!\nAdd the new bug behind the command!");
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/commands/moderation/Warning.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ public class Warning implements Command{
public void perform(SlashCommandEvent event) {
Guild guild = event.getGuild();
User user = event.getUser();
Bot.INSTANCE.penaltyCheck(guild);
if (Configloader.INSTANCE.getGuildConfig(guild, "modrole").equals("")) {
event.replyEmbeds(AnswerEngine.ae.fetchMessage(guild, user, "/commands/moderation/warning:nomodrole")).queue();
return;
}
if (!event.getMember().getRoles().contains(guild.getRoleById(Configloader.INSTANCE.getGuildConfig(guild, "modrole")))) {
event.replyEmbeds(AnswerEngine.ae.fetchMessage(guild, user,"/commands/moderation/warning:nopermission")).queue();
return;
}
if (event.getSubcommandName().equals("add")) {
final User iuser = event.getOption("user").getAsUser();
Expand All @@ -51,7 +48,6 @@ public void perform(SlashCommandEvent event) {
AnswerEngine.ae.getDescription(guild, iuser, "/commands/moderation/warning:pm").replace("{guild}", guild.getName()).replace("{reason}", reason))).queue();
});
} catch (Exception e) {}
return;
}
if (event.getSubcommandName().equals("list")) {
this.listwarnings(event);
Expand All @@ -76,6 +72,7 @@ public void perform(SlashCommandEvent event) {
() -> {channel.sendMessageEmbeds(AnswerEngine.ae.fetchMessage(guild, user,"/commands/moderation/warning:timeout")).queue(response -> response.delete().queueAfter(3, TimeUnit.SECONDS));});
}
}
Bot.INSTANCE.penaltyCheck(guild);
}

@Override
Expand Down

0 comments on commit b03e7e6

Please sign in to comment.