Skip to content

[Feature Request] Telegram: Resolve and include forum topic name in inbound message metadata #43007

Description

@chphch

Problem

When OpenClaw receives messages from a Telegram forum group (supergroup with topics enabled), the inbound message metadata only includes topic_id (the internal Telegram thread ID), but not the topic name.

This is because the Telegram Bot API does not include the topic name in the Message object - it only provides message_thread_id. The topic name requires a separate API call (getForumTopicInfo) to retrieve.

Expected Behavior

The inbound message metadata should include topic_name alongside topic_id, so the agent can identify which topic a message came from in a human-readable way.

Suggested Solution

When OpenClaw receives a message with a message_thread_id, it could:

  1. Call getForumTopicInfo to fetch the topic name
  2. Cache the result (topic names rarely change)
  3. Include topic_name in the metadata passed to the agent

Context

Currently, a user's topic named "topic2" appears only as topic_id: 12 in the metadata, with no way for the agent to know the human-readable name without additional API calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions