bot
commited on
Commit
·
919a7cc
1
Parent(s):
8929076
Fix
Browse files
main.py
CHANGED
@@ -119,6 +119,7 @@ async def log_token(THUNDERX_CLIENT, extra_data):
|
|
119 |
|
120 |
THUNDERX_CLIENT = None
|
121 |
TG_BOT_APPLICATION = None
|
|
|
122 |
|
123 |
|
124 |
###################TG机器人功能区###################
|
@@ -165,10 +166,7 @@ async def init_client():
|
|
165 |
print("未设置TG_BOT_TOKEN无法实现TG机器人功能!")
|
166 |
else:
|
167 |
TG_BOT_APPLICATION = (
|
168 |
-
Application.builder()
|
169 |
-
.base_url("https://tg.alist.dpdns.org/bot")
|
170 |
-
.token(TG_BOT_TOKEN)
|
171 |
-
.build()
|
172 |
)
|
173 |
print("==========test==============")
|
174 |
# await TG_BOT_APPLICATION.bot.delete_webhook()
|
@@ -177,6 +175,7 @@ async def init_client():
|
|
177 |
# 将命令处理函数添加到 dispatcher
|
178 |
TG_BOT_APPLICATION.add_handler(CommandHandler("start", start))
|
179 |
TG_BOT_APPLICATION.add_handler(CommandHandler("help", help))
|
|
|
180 |
|
181 |
|
182 |
# FastAPI 路由:接收来自 Telegram 的 Webhook 回调
|
|
|
119 |
|
120 |
THUNDERX_CLIENT = None
|
121 |
TG_BOT_APPLICATION = None
|
122 |
+
TG_BASE_URL = "https://tg.alist.dpdns.org/bot"
|
123 |
|
124 |
|
125 |
###################TG机器人功能区###################
|
|
|
166 |
print("未设置TG_BOT_TOKEN无法实现TG机器人功能!")
|
167 |
else:
|
168 |
TG_BOT_APPLICATION = (
|
169 |
+
Application.builder().base_url(TG_BASE_URL).token(TG_BOT_TOKEN).build()
|
|
|
|
|
|
|
170 |
)
|
171 |
print("==========test==============")
|
172 |
# await TG_BOT_APPLICATION.bot.delete_webhook()
|
|
|
175 |
# 将命令处理函数添加到 dispatcher
|
176 |
TG_BOT_APPLICATION.add_handler(CommandHandler("start", start))
|
177 |
TG_BOT_APPLICATION.add_handler(CommandHandler("help", help))
|
178 |
+
TG_BOT_APPLICATION.run_polling(allowed_updates=Update.ALL_TYPES)
|
179 |
|
180 |
|
181 |
# FastAPI 路由:接收来自 Telegram 的 Webhook 回调
|