#Configure Telegram Topics

1 messages · Page 1 of 1 (latest)

wintry temple
#

This is the configuration that i have right now:

"channels": {
    "telegram": {
      "enabled": true,
      "dmPolicy": "allowlist",
      "botToken": "xx",
      "allowFrom": [
        "18298582"
      ],
      "groupPolicy": "open",
      "streamMode": "partial"
    }
  }

I want to enable the bot to answer inside a group, and i want to create topics inside that group. How can i enable the bot to reply inside the group topic and how can i set different agents (personality/soul/prompts) for each topic?

raven pilotBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

left spokeBOT
# wintry temple This is the configuration that i have right now: ``` "channels": { "telegra...

Based on the documentation and source code, here's how to set up Telegram group topics with different agents/personalities:

1. Enable Bot to Reply in Group Topics

Your current config is close, but you need to:

  • Set groupPolicy to "allowlist" or "open"
  • Add groupAllowFrom to specify who can talk in groups
  • Add the group to groups allowlist
{
  channels: {
    telegram: {
      enabled: true,
      botToken: "8419548218:AAGVv95c_X3_o_6zlquiwHrZYJ3_SmIdK24",
      dmPolicy: "allowlist",
#
      allowFrom: ["182985827"],
      groupPolicy: "allowlist",  // or "open" for everyone
      groupAllowFrom: ["182985827"],  // who can talk in groups
      groups: {
        "-1001234567890": {  // your group ID (negative number)
          requireMention: false,  // or true if you want mentions only
          topics: {
            "99": {  // topic thread ID
              // topic-specific config
            }
          }
        }
      }
    }
  }
#
}

2. Different Agents/Personalities per Topic

Option A: System Prompt Override (Simple)

Use systemPrompt to customize personality per topic:

{
  channels: {
    telegram: {
      groups: {
        "-1001234567890": {
#
          systemPrompt: "You are a helpful group assistant.",
          topics: {
            "99": {  // General chat topic
              systemPrompt: "You are a casual, friendly assistant."
            },
            "100": {  // Tech support topic
              systemPrompt: "You are a technical expert. Be precise and detailed."
            },
            "101": {  // Fun/coding challenge topic  
              systemPrompt: "You are playful and love coding challenges. Use emojis! 🎉"
            }
          }
        }
      }
    }
#
  }
}

Option B: Different Skills per Topic

{
  channels: {
    telegram: {
      groups: {
        "-1001234567890": {
          skills: ["common-skills"],
          topics: {
            "99": {
#
              skills: []  // no extra skills
            },
            "100": {
              skills: ["developer", "research"]  // technical skills
            },
            "101": {
              skills: ["summarize", "fun"]  // fun skills
            }
          }
        }
      }
    }
  }
}
#

Option C: Full Multi-Agent Routing (Advanced)

For completely different agents with separate workspaces/configs, use bindings:

{
  agents: {
    defaults: {
      workspace: "~/clawd"
    },
    list: [
      {
        id: "main",
        name: "Main Assistant",
        identity: { name: "Assistant", emoji: "🤖" }
      },
#
      {
        id: "tech-expert",
        name: "Tech Expert",
        identity: { name: "TechBot", emoji: "💻" },
        workspace: "~/clawd-tech"
      }
    ]
  },
  bindings: [
    {
      match: { channel: "telegram" },
      agentId: "main"
    }
  ]
}
#

Note: Full topic→agent routing isn't directly supported in bindings yet. The workaround is using systemPrompt to change personality.

Finding Topic Thread IDs

Topics have a message_thread_id. To find the ID:

  1. Send a test message in the topic
  2. Check logs: clawdbot logs --follow
  3. Look for message_thread_id in the message context

The topic configuration merges with group config - group systemPrompt runs first, then topic systemPrompt is appended.

wintry temple
#

I tried to add the bot in my group and got this from the logs:

11:41:06 info telegram-auto-reply {"module":"telegram-auto-reply"} {"chatId":-1003699841147,"title":"ClawdBot","reason":"not-allowed"} skipping group message

left spokeBOT
# wintry temple I tried to add the bot in my group and got this from the logs: 11:41:06 info te...

The bot is rejecting the group because it's not in the allowlist. Add the group ID to your config:

{
  channels: {
    telegram: {
      enabled: true,
      botToken: "8419548218:AAGVv95c_X3_o_6zlquiwHrZYJ3_SmIdK24",
      dmPolicy: "allowlist",
      allowFrom: ["182985827"],
      groupPolicy: "allowlist",
      groupAllowFrom: ["182985827"],  // or ["*"] for everyone
      groups: {
        "-1003699841147": {  // ← add your group ID here
          requireMention: false
        }
#
      }
    }
  }
}

After updating config, restart the gateway or use hot reload if configured. The bot will then respond in that group.

To find your group ID: forward any message from the group to @userinfobot or check clawdbot logs --follow (you already have it: -1003699841147).

wintry temple
#

I set the correct group and topic id, but i don't see any response

left spokeBOT
# wintry temple I set the correct group and topic id, but i don't see any response

Let me check a few things to debug this:

  1. Is the gateway running? Check: clawdbot status

  2. Check logs for errors:

    clawdbot logs --follow | grep -i telegram
    
  3. Quick test - send a mention:
    In the topic, send @YourBotName - does the bot respond?

  4. Common issue - Privacy Mode:
    Did you disable privacy mode in @BotFather? Run /setprivacyDisable (not Group Privacy, disable entirely), then remove and re-add the bot to the group.

  5. Verify bot is an admin in the group (can help with visibility).

#

What do you see in the logs when you send a message in the topic?

wintry temple
#

I have two topics, one with the number "1" and other with number "37", i have this config:

"topics": {
"1": {
"systemPrompt": "You are a casual, friendly assistant. This is a general topic"
}
}

when i send something from topic 37 i got response, but if i send from topic 1, i got this from the logs:

"12:12:56 error gateway/channels/telegram {"subsystem":"gateway/channels/telegram"} telegram final reply failed: GrammyError: Call to 'sendMessage' failed! (400: Bad Request: message thread not found)"

left spokeBOT
# wintry temple I have two topics, one with the number "1" and other with number "37", i have th...

Topic ID 1 is often a reserved/special topic in Telegram forums. Try creating a new topic with a different number (like 2, 10, 50) and test with that.

The message thread not found error means Telegram can't find a topic with that ID - topic 1 may have been deleted or is reserved.

Steps:

  1. Create a new topic in the group (name it whatever)
  2. Get its thread ID (check logs or forward a message to @getidsbot)
  3. Update your config with the new ID
wintry temple
#

Nice it is working now. I want to setup a topic specific for grocery shopping list, do we have any skills that can help me with that? how can i add it?

left spokeBOT
# wintry temple Nice it is working now. I want to setup a topic specific for grocery shopping li...

There's no dedicated grocery list skill, but you can set this up with a custom system prompt:

Option 1: Simple In-Memory List (easiest)

Add a system prompt for the grocery topic:

{
  channels: {
    telegram: {
      groups: {
        "-1003699841147": {
          topics: {
            "37": {  // grocery topic
              systemPrompt: "You are a grocery shopping assistant. Keep track of items people want to buy. When someone says 'add X' or 'need X', add it to the list. When someone says 'bought X' or 'got X', mark it as done. When asked 'what do we need?' or 'shopping list', list all items with their status (needed/done). Format as a simple checklist."
            }
#
          }
        }
      }
    }
  }
}

Usage:

  • "add milk, eggs, bread" → adds items
  • "bought eggs" → marks eggs as done
  • "shopping list?" → shows all items

Option 2: Sync with Notes/Reminders

Use existing skills to persist the list:

#
  • apple-reminders skill → sync to Apple Reminders
  • obsidian skill → save to an Obsidian note
  • notion skill → save to a Notion page

Example with Apple Reminders:

{
  channels: {
    telegram: {
      groups: {
        "-1003699841147": {
          topics: {
            "37": {
              skills: ["apple-reminders"],
              systemPrompt: "You manage a grocery list. When someone says 'add X', create a reminder 'Buy X'. When someone says 'remove X' or 'bought X', complete the reminder 'Buy X'. When asked for the list, list all incomplete reminders from the 'Grocery' list."