feat(exec-bridge): send typing indicator on start

This commit is contained in:
banteg
2025-12-28 20:30:56 +04:00
parent 245d22eb82
commit 0a984e228a
2 changed files with 12 additions and 0 deletions
@@ -139,6 +139,13 @@ class TelegramClient:
sent.append(msg)
return sent
def send_chat_action(self, chat_id: int, action: str = "typing") -> Dict[str, Any]:
params: Dict[str, Any] = {
"chat_id": chat_id,
"action": action,
}
return self._call("sendChatAction", params)
@dataclass(frozen=True)
class Route:
@@ -193,6 +193,11 @@ def main() -> None:
f"chat_id={chat_id} user_msg_id={user_msg_id} resume_session={resume_session!r}"
)
try:
try:
bot.send_chat_action(chat_id=chat_id, action="typing")
log(f"[handle] sent typing indicator chat_id={chat_id}")
except Exception as e:
log(f"[handle] failed typing indicator chat_id={chat_id}: {e}")
session_id, answer = runner.run_serialized(text, resume_session)
sent_msgs = bot.send_message_chunked(
chat_id=chat_id,