Skip to content

Telegram channel: keep sending typing indicator while processing #932

@duda-web

Description

@duda-web

Problem

When a message arrives via the Telegram channel (--channels plugin:telegram), the bot sends a sendChatAction("typing") once at the start. However, Telegram's typing indicator only lasts ~5 seconds. For queries that take 30s-2min (e.g., querying external APIs via MCP tools, reading multiple files), the typing indicator disappears long before the response arrives.

From the user's perspective, this creates uncertainty: they don't know if the bot is still processing or if it silently failed. This is especially problematic because --channels is experimental and sessions can sometimes stop responding without crashing.

Expected behavior

The Telegram channel plugin should re-send sendChatAction("typing") every 4-5 seconds while Claude is actively processing a response (thinking, reading files, calling tools, generating text).

Suggested implementation

In the channel server's message handler, start an interval that sends sendChatAction("typing") every 4s when a message is received, and clear it when the response is sent via reply.

const typingInterval = setInterval(() => {
  bot.api.sendChatAction(chatId, "typing");
}, 4000);

// ... process message and send reply ...

clearInterval(typingInterval);

Environment

  • Claude Code v2.1.81
  • macOS
  • --channels plugin:telegram@claude-plugins-official
  • Using Opus 4.6 with high effort (responses often take 30s-2min)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions