From 6f63e0a5d7ae059c7a47880faa965d322722e21e Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 8 Mar 2026 09:48:42 +0800 Subject: [PATCH] feat: enhance Telegram module with new functionality and improvements. --- app/modules/telegram/telegram.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/modules/telegram/telegram.py b/app/modules/telegram/telegram.py index 20457e1f..513e173b 100644 --- a/app/modules/telegram/telegram.py +++ b/app/modules/telegram/telegram.py @@ -80,6 +80,11 @@ class Telegram: # Check if we should process this message if self._should_process_message(message): + # 发送正在输入状态 + try: + _bot.send_chat_action(message.chat.id, 'typing') + except Exception as e: + logger.error(f"发送Telegram正在输入状态失败:{e}") RequestUtils(timeout=15).post_res(self._ds_url, json=message.json) @_bot.callback_query_handler(func=lambda call: True) @@ -115,6 +120,12 @@ class Telegram: # 先确认回调,避免用户看到loading状态 _bot.answer_callback_query(call.id) + # 发送正在输入状态 + try: + _bot.send_chat_action(call.message.chat.id, 'typing') + except Exception as e: + logger.error(f"发送Telegram正在输入状态失败:{e}") + # 发送给主程序处理 RequestUtils(timeout=15).post_res(self._ds_url, json=callback_json)