From 76f3ffd7f72c902df6f213b6dca9f0e609fdbcf9 Mon Sep 17 00:00:00 2001 From: OG T Date: Sun, 5 Apr 2026 13:40:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(telegram):=20whitelist=20property=20?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=AD=97=E4=B8=B2=E5=B0=8E=E8=87=B4=E6=8C=89?= =?UTF-8?q?=E9=88=95=E7=84=A1=E5=8F=8D=E6=87=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit security_interceptor.whitelist 返回 settings.OPENCLAW_TG_USER_WHITELIST (字串),但 is_whitelisted 做 user_id in whitelist(int in str), Python 報 "requires string as left operand, not int"。 修正:改呼叫 settings.get_tg_user_whitelist() 返回 list[int]。 Co-Authored-By: Claude Sonnet 4.6 --- apps/api/src/services/security_interceptor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/services/security_interceptor.py b/apps/api/src/services/security_interceptor.py index de262923..4780cd6f 100644 --- a/apps/api/src/services/security_interceptor.py +++ b/apps/api/src/services/security_interceptor.py @@ -236,7 +236,7 @@ class TelegramSecurityInterceptor: @property def whitelist(self) -> list[int]: """取得白名單 user_id 列表""" - return settings.OPENCLAW_TG_USER_WHITELIST + return settings.get_tg_user_whitelist() def is_whitelisted(self, user_id: int) -> bool: """