Browse Source

Method created to send Admin Log Updates to users.

master
MagicBot 2 years ago
parent
commit
fba041db5e
  1. 26
      src/discord/MagicBot.java

26
src/discord/MagicBot.java

@ -31,6 +31,9 @@ import java.io.*; @@ -31,6 +31,9 @@ import java.io.*;
import java.util.*;
import java.util.regex.Pattern;
import static discord.ChatChannel.ADMINLOG;
import static discord.ChatChannel.SEPTIC;
/*
* MagicBot is many things to Magicbane...
*
@ -119,11 +122,7 @@ public class MagicBot extends ListenerAdapter { @@ -119,11 +122,7 @@ public class MagicBot extends ListenerAdapter {
Logger.info("***MAGICBOT IS RUNNING***");
HashMap<Integer, String> adminEvents = database.getAdminEvents();
for (String adminEvent : adminEvents.values()) {
Logger.info(adminEvent);
}
SendAdminLogUpdates();
}
@ -363,7 +362,8 @@ public class MagicBot extends ListenerAdapter { @@ -363,7 +362,8 @@ public class MagicBot extends ListenerAdapter {
Writer fileWriter;
if (inString == null)
return;;
return;
;
outString = command + String.join(" ", inString);
outString += "\n";
@ -376,4 +376,18 @@ public class MagicBot extends ListenerAdapter { @@ -376,4 +376,18 @@ public class MagicBot extends ListenerAdapter {
e.printStackTrace();
}
}
private static void SendAdminLogUpdates() {
HashMap<Integer, String> adminEvents = database.getAdminEvents();
for (String adminEvent : adminEvents.values()) {
String outString =
"```\n" + "Hello Players \n\n" +
adminEvent + "\n\n" +
RobotSpeak.getRobotSpeak() + "\n```";
if (ADMINLOG.textChannel.canTalk())
ADMINLOG.textChannel.sendMessage(outString).queue();
}
}
}

Loading…
Cancel
Save