mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
fix webhook_parser
This commit is contained in:
@@ -89,13 +89,10 @@ class TelegramModule(_ModuleBase, _MessageBase):
|
||||
}
|
||||
"""
|
||||
# 获取渠道
|
||||
client_config = self.get_config(source, 'telegram')
|
||||
if not client_config:
|
||||
return None
|
||||
client: Telegram = self.get_client(source)
|
||||
if not client:
|
||||
return None
|
||||
# 获取配置
|
||||
config = self.get_config(source)
|
||||
if not config:
|
||||
return None
|
||||
# 校验token
|
||||
token = args.get("token")
|
||||
if not token or token != settings.API_TOKEN:
|
||||
@@ -113,9 +110,9 @@ class TelegramModule(_ModuleBase, _MessageBase):
|
||||
if text:
|
||||
logger.info(f"收到来自 {source} 的Telegram消息:userid={user_id}, username={user_name}, text={text}")
|
||||
# 检查权限
|
||||
admin_users = config.config.get("TELEGRAM_ADMINS")
|
||||
user_list = config.config.get("TELEGRAM_USERS")
|
||||
chat_id = config.config.get("TELEGRAM_CHAT_ID")
|
||||
admin_users = client_config.config.get("TELEGRAM_ADMINS")
|
||||
user_list = client_config.config.get("TELEGRAM_USERS")
|
||||
chat_id = client_config.config.get("TELEGRAM_CHAT_ID")
|
||||
if text.startswith("/"):
|
||||
if admin_users \
|
||||
and str(user_id) not in admin_users.split(',') \
|
||||
|
||||
Reference in New Issue
Block a user