From 982902fc6de3d4298ef305b5b12fc46bc9009a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 19 Dec 2022 16:54:15 +0100 Subject: [PATCH] Ignore bots interacting with hideko --- .../beatrice/hidekobot/listeners/MessageCommandListener.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/wtf/beatrice/hidekobot/listeners/MessageCommandListener.java b/src/main/java/wtf/beatrice/hidekobot/listeners/MessageCommandListener.java index bf16c3b..3bcd069 100644 --- a/src/main/java/wtf/beatrice/hidekobot/listeners/MessageCommandListener.java +++ b/src/main/java/wtf/beatrice/hidekobot/listeners/MessageCommandListener.java @@ -57,6 +57,9 @@ public class MessageCommandListener extends ListenerAdapter @Override public void onMessageReceived(@NotNull MessageReceivedEvent event) { + // check if a bot is sending this message, and ignore it + if(event.getAuthor().isBot()) return; + // warning: we are getting the RAW value of the message content, not the DISPLAY value! String eventMessage = event.getMessage().getContentRaw();