From 7b78ce7d067b405f2c5a102dcc0bcae02816ef96 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 10 Nov 2024 19:25:42 +0700 Subject: [PATCH] fix: prevent whitelist from kicking the bot itself --- .../me/chayapak1/chomens_bot/plugins/WhitelistPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/WhitelistPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/WhitelistPlugin.java index b8aad49..c89d09f 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/WhitelistPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/WhitelistPlugin.java @@ -72,7 +72,7 @@ public class WhitelistPlugin extends PlayersPlugin.Listener { } public void commandReceived (PlayerEntry entry, String command) { - if (!enabled || list.contains(entry.profile.getName())) return; + if (!enabled || list.contains(entry.profile.getName()) || entry.profile.equals(bot.profile)) return; if ( command.startsWith("mute") || @@ -90,7 +90,7 @@ public class WhitelistPlugin extends PlayersPlugin.Listener { } private void handle (PlayerEntry entry) { - if (!enabled || list.contains(entry.profile.getName())) return; + if (!enabled || list.contains(entry.profile.getName()) || entry.profile.equals(bot.profile)) return; bot.filter.doAll(entry); }