Telegram setup
Connect a Telegram bot to your agent, including the slash commands users get automatically.
Connecting a Telegram bot routes messages from Telegram to your agent and sends its replies back. It uses webhooks — Telegram pushes messages to KlicForge, so there is nothing to poll and nothing to host.
Prerequisites
- A Telegram account.
- An agent with status
active. - A plan that includes the Telegram channel.
Connecting
Create a bot
Message @BotFather on Telegram, create a bot, and copy the token it gives you.
Connect it
In the dashboard, open your agent's Channels tab and select Connect Channel → Telegram. Paste the bot token and save.
Confirm
KlicForge encrypts the token and registers the webhook with Telegram automatically. Message your bot to check it replies.
Expected result
Messages sent to your bot are answered by the agent, and the conversations appear in the dashboard.
Slash commands
/start and /reset are registered with Telegram automatically when the channel connects, so
they appear in the bot's command menu. /help is recognised in the message text like any other
command, without appearing in that menu.
| Command | What it does |
|---|---|
/start | Starts a new conversation, keeping what the agent remembers about the contact |
/reset | Starts a new conversation and excludes the session from memory |
/help | Lists the commands available on this channel |
/start and /reset answer immediately with a short greeting from the agent. The greeting is
fixed text, so an agent cannot be prompted to look anything up before replying to a command.
Group chats
A Telegram bot can be added to a group. Group behaviour is configurable so the agent responds only when it should — for example when mentioned — rather than to every message.
By default the agent replies only when someone tags the bot's own handle, sends a command meant for it, or replies to one of its messages. Tagging another member does not trigger it.
A group appears in the Inbox as one conversation under the group's name (in a group with forum topics, each topic is its own conversation), with each message labelled by the member who sent it. Each member is still their own contact (the same contact as when they message the bot directly), so details one person shares are saved to their record only. The group conversation also appears on the contact of every member who has messaged the bot there, alongside their direct conversations. When several members tag the bot at once, each gets their own reply in turn, sent as a reply to their message, and the agent sees the earlier replies when it answers the next. If one person sends a quick follow-up before the agent has answered them (such as a correction), the agent answers both messages together. In a group the agent does not use memories, because everyone in the group reads its replies. When someone replies to a message, the agent sees the text being replied to.
A group's conversation closes after a day without messages, like any Telegram conversation. When the group talks to the bot again, the agent starts with short summaries of its last few sessions in that group, so it can pick up where things were left. Reminders or follow-ups someone asks for in a group are sent to the group.
Sending /start or /reset in a group restarts the group's conversation.
Group conversations from before this behaviour shipped are left as they were, so any details members shared there stay on the contact of whoever first messaged the bot in that group.
Restricting who can chat
A Telegram bot is reachable by anyone who finds it, so a bot meant for staff or paying customers needs an allow list. Set the channel to Restricted on its Allow List tab and add the people who may use it.
Entries can be contacts who have messaged before, or rows from a data table with a
telegram_id or telegram_handle column — which is how you authorise someone who has not
messaged yet. Telegram confirms the sender's identity, so these entries hold. See
access control.
Disconnecting
From the agent's Channels tab, select Disconnect. KlicForge deregisters the webhook with Telegram for you.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Bot does not reply at all | Agent status is not active, or the token was mistyped |
| Bot replies in direct messages but not groups | Group settings, or Telegram's own bot privacy mode |
| Bot stopped working after an infrastructure change | The webhook URL changed — reconnect the channel |
| Specific people get no reply | A deny list entry is filtering them |
| Nobody gets a reply | The channel is Restricted and the allow list matches nobody |
| Someone on the allow list is refused | Their handle is stored differently in the data table than the one they message from |