Open oceanz764 opened 1 week ago
一样的问题,我设置了tgbot反代,但是每个人的库notify.py关于反代都不一样, def telegram_bot(title: str, content: str) -> None: """ 使用 telegram 机器人 推送消息。 """ if not push_config.get("TG_BOT_TOKEN") or not push_config.get("TG_USER_ID"): print("tg 服务的 bot_token 或者 user_id 未设置!!\n取消推送") return print("tg 服务启动")
if push_config.get("TG_API_HOST"):
url = f"{push_config.get('TG_API_HOST')}/bot{push_config.get('TG_BOT_TOKEN')}/sendMessage"
else:
url = (
f"https://api.telegram.org/bot{push_config.get('TG_BOT_TOKEN')}/sendMessage"
)
headers = {"Content-Type": "application/x-www-form-urlencoded"}
payload = {
"chat_id": str(push_config.get("TG_USER_ID")),
"text": f"{title}\n\n{content}",
"disable_web_page_preview": "true",
}
有些需要加https:// 有些不需要,建议添加
url = f"{push_config.get('TG_API_HOST')}/bot{push_config.get('TG_BOT_TOKEN')}/sendMessage"
else:
url = f"https://{push_config.get('TG_API_HOST')}/bot{push_config.get('TG_BOT_TOKEN')}/sendMessage"
解决了吗, 我尝试解决,没搞定
Qinglong version
V2.17.12
Steps to reproduce
Telegram 发送通知消息失败😞 RequestError at ClientRequest. (/ql/node_modules/.pnpm/got@11.8.6/node_modules/got/dist/source/core/index.js:970:111)
at Object.onceWrapper (node:events:634:26)
at ClientRequest.emit (node:events:531:35)
at origin.emit (/ql/node_modules/.pnpm/@szmarczak+http-timer@4.0.6/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
at TLSSocket.socketErrorListener (node:_http_client:500:9)
at TLSSocket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1117:18)
at internalConnectMultiple (node:net:1185:5)
at Timeout.internalConnectMultipleTimeout (node:net:1711:5)
at listOnTimeout (node:internal/timers:575:11)
at process.processTimers (node:internal/timers:514:7) {
code: 'ETIMEDOUT',
timings: {
start: 1731295532933,
socket: 1731295532934,
lookup: 1731295532940,
connect: undefined,
secureConnect: undefined,
upload: undefined,
response: undefined,
end: undefined,
error: 1731295533193,
abort: undefined,
phases: {
wait: 1,
dns: 6,
tcp: undefined,
tls: undefined,
request: undefined,
firstByte: undefined,
download: undefined,
total: 260
}
}
}
What is expected?
推送失败问题
What is actually happening?
Tgbot一直推送失败
System Info
No response
Any additional comments?
No response