mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-06 23:31:28 +08:00
fix download && message
This commit is contained in:
@@ -113,9 +113,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("admins")
|
||||
user_list = config.config.get("users")
|
||||
chat_id = config.config.get("chat_id")
|
||||
admin_users = config.config.get("TELEGRAM_ADMINS")
|
||||
user_list = config.config.get("TELEGRAM_USERS")
|
||||
chat_id = config.config.get("TELEGRAM_CHAT_ID")
|
||||
if text.startswith("/"):
|
||||
if admin_users \
|
||||
and str(user_id) not in admin_users.split(',') \
|
||||
|
||||
@@ -25,17 +25,17 @@ class Telegram:
|
||||
_event = Event()
|
||||
_bot: telebot.TeleBot = None
|
||||
|
||||
def __init__(self, token: str = None, chat_id: str = None, **kwargs):
|
||||
def __init__(self, TELEGRAM_TOKEN: str = None, TELEGRAM_CHAT_ID: str = None, **kwargs):
|
||||
"""
|
||||
初始化参数
|
||||
"""
|
||||
if not token or not chat_id:
|
||||
if not TELEGRAM_TOKEN or not TELEGRAM_CHAT_ID:
|
||||
logger.error("Telegram配置不完整!")
|
||||
return
|
||||
# Token
|
||||
self._telegram_token = token
|
||||
self._telegram_token = TELEGRAM_TOKEN
|
||||
# Chat Id
|
||||
self._telegram_chat_id = chat_id
|
||||
self._telegram_chat_id = TELEGRAM_CHAT_ID
|
||||
# 初始化机器人
|
||||
if self._telegram_token and self._telegram_chat_id:
|
||||
# bot
|
||||
|
||||
Reference in New Issue
Block a user