From 7d17285a0c6bd41c5741d1db52d2bd2bfd00ebc6 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 3 Apr 2025 16:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20ensure=20whitelist=20entr?= =?UTF-8?q?ies=20are=20stripped=20of=20whitespace=20and=20converted=20to?= =?UTF-8?q?=20strings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/pipeline/whitelist_check/stage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/astrbot/core/pipeline/whitelist_check/stage.py b/astrbot/core/pipeline/whitelist_check/stage.py index 85f911a60..b140d23ba 100644 --- a/astrbot/core/pipeline/whitelist_check/stage.py +++ b/astrbot/core/pipeline/whitelist_check/stage.py @@ -15,6 +15,9 @@ class WhitelistCheckStage(Stage): "enable_id_white_list" ] self.whitelist = ctx.astrbot_config["platform_settings"]["id_whitelist"] + self.whitelist = [ + str(i).strip() for i in self.whitelist if str(i).strip() != "" + ] self.wl_ignore_admin_on_group = ctx.astrbot_config["platform_settings"][ "wl_ignore_admin_on_group" ] @@ -53,7 +56,7 @@ class WhitelistCheckStage(Stage): return if ( event.unified_msg_origin not in self.whitelist - and event.get_group_id() not in self.whitelist + and str(event.get_group_id()).strip() not in self.whitelist ): if self.wl_log: logger.info(