fix file transfer

This commit is contained in:
jxxghp
2023-06-09 12:19:11 +08:00
parent fd3ecacbb2
commit 8dd11bb53d
8 changed files with 41 additions and 17 deletions

View File

@ -33,13 +33,13 @@ class Telegram(metaclass=Singleton):
@_bot.message_handler(func=lambda message: True)
def echo_all(message):
RequestUtils(timeout=10).post_res(self._ds_url, json=message.json)
RequestUtils(timeout=5).post_res(self._ds_url, json=message.json)
def run_polling():
"""
定义线程函数来运行 infinity_polling
"""
_bot.infinity_polling()
_bot.infinity_polling(long_polling_timeout=5)
# 启动线程来运行 infinity_polling
self._polling_thread = threading.Thread(target=run_polling)