You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

python-telegram-bot中ConversationHandler执行长任务后程序意外退出

Telegram Bot ConversationHandler处理长任务后意外退出问题
  • 问题现象:Bot在ConversationHandler中完成一个长时间运行的任务后意外关闭,send_document功能执行正常,但程序后续无报错直接退出。
  • 开启DEBUG日志后得到以下输出:
2023-03-26 21:55:57,438 - telegram._bot - DEBUG - Exiting: send_document
2023-03-26 21:55:57,440 - telegram.ext._application - DEBUG - Dropping pending updates
2023-03-26 21:55:57,441 - telegram.ext._application - DEBUG - Application stopped fetching of updates.
2023-03-26 21:55:57,441 - telegram.ext._application - DEBUG - Waiting for `create_task` calls to be processed
2023-03-26 21:55:57,441 - telegram.ext._application - INFO - Application.stop() complete
2023-03-26 21:55:57,442 - telegram._bot - DEBUG - This Bot is already shut down. Returning.
2023-03-26 21:55:57,442 - telegram.ext._updater - DEBUG - Shut down of Updater complete
  • 已添加错误处理器用于打印回溯信息,但控制台无任何输出。

内容的提问来源于stack exchange,提问作者mtdot

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 19:12:35