From 3b7a140aadaf35392c9862b0f8c3e537cd427ef0 Mon Sep 17 00:00:00 2001 From: junbaor Date: Mon, 16 Feb 2026 04:02:36 +0800 Subject: [PATCH] feat(telegram): add typing indicator when receiving messages - Send 'typing' chat action immediately upon receiving a message - Improves user experience by showing the bot is processing - Telegram displays '...is typing' indicator while the AI generates response - Gracefully ignores errors to avoid breaking message handling Previously, there was no typing indicator implementation, causing users to wait without feedback during AI response generation. --- src/channels/telegram.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/channels/telegram.rs b/src/channels/telegram.rs index f3be679..eadc05d 100644 --- a/src/channels/telegram.rs +++ b/src/channels/telegram.rs @@ -500,6 +500,17 @@ Allowlist Telegram @username or numeric user ID, then run `zeroclaw onboard --ch .map(|id| id.to_string()) .unwrap_or_default(); + // Send "typing" indicator immediately when we receive a message + let typing_body = serde_json::json!({ + "chat_id": &chat_id, + "action": "typing" + }); + let _ = self.client + .post(self.api_url("sendChatAction")) + .json(&typing_body) + .send() + .await; // Ignore errors for typing indicator + let msg = ChannelMessage { id: Uuid::new_v4().to_string(), sender: chat_id,