diff --git a/src/main/java/wtf/beatrice/hidekobot/Configuration.java b/src/main/java/wtf/beatrice/hidekobot/Configuration.java index a3525f6..7107efe 100644 --- a/src/main/java/wtf/beatrice/hidekobot/Configuration.java +++ b/src/main/java/wtf/beatrice/hidekobot/Configuration.java @@ -5,6 +5,7 @@ public class Configuration private static boolean verbose = false; + private static boolean paused = false; public static boolean isVerbose() { return verbose; } @@ -12,4 +13,7 @@ public class Configuration // WARNING: verbosity spams the logs a LOT! public static void setVerbose(boolean v) { verbose = v; } + public static boolean isPaused() { return paused; } + public static void setPaused(boolean p) { paused = p; } + } diff --git a/src/main/java/wtf/beatrice/hidekobot/listeners/MessageListener.java b/src/main/java/wtf/beatrice/hidekobot/listeners/MessageListener.java index eba403b..8451318 100644 --- a/src/main/java/wtf/beatrice/hidekobot/listeners/MessageListener.java +++ b/src/main/java/wtf/beatrice/hidekobot/listeners/MessageListener.java @@ -4,6 +4,7 @@ import net.dv8tion.jda.api.entities.*; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.hooks.ListenerAdapter; import org.jetbrains.annotations.NotNull; +import wtf.beatrice.hidekobot.Configuration; import wtf.beatrice.hidekobot.HidekoBot; import wtf.beatrice.hidekobot.utils.Logger; import wtf.beatrice.hidekobot.utils.RandomUtil; @@ -23,6 +24,21 @@ public class MessageListener extends ListenerAdapter { String eventMessage = event.getMessage().getContentDisplay(); + + if(eventMessage.equalsIgnoreCase("hideko pause")) + { + MessageChannel channel = event.getChannel(); + + boolean paused = Configuration.isPaused(); + String msg = paused ? ":white_check_mark: Resuming normal activity!" : ":pause_button: Pausing!"; + Configuration.setPaused(!paused); + channel.sendMessage(msg).queue(); + + return; + } + + if(Configuration.isPaused()) return; + if(eventMessage.equalsIgnoreCase("hideko")) { MessageChannel channel = event.getChannel();