From ffab94f52505bf60f299ae48cd22d192522b4a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Fri, 26 Aug 2022 03:46:36 +0200 Subject: [PATCH] Add basic shutdown command --- .../hidekobot/listeners/MessageListener.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/wtf/beatrice/hidekobot/listeners/MessageListener.java b/src/main/java/wtf/beatrice/hidekobot/listeners/MessageListener.java index a93cd1d..b5acafb 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.HidekoBot; import wtf.beatrice.hidekobot.utils.Logger; import wtf.beatrice.hidekobot.utils.RandomUtil; @@ -85,5 +86,17 @@ public class MessageListener extends ListenerAdapter return; } + + + if(eventMessage.equalsIgnoreCase("hideko die")) + { + MessageChannel channel = event.getChannel(); + + channel.sendMessage("Going to sleep! Cya :sparkles:").queue(); + + HidekoBot.getAPI().shutdown(); + System.exit(0); + return; + } } }