Skip to Content

Telegram setup

Connect your agent to Telegram with your own bot. It takes about two minutes: create a bot with Telegram’s official BotFather, find your Telegram user id, and paste both into Cohort. Your agent then answers your messages in Telegram — DMs and group chats.

You’ll need two things: a bot token (from BotFather) and your numeric Telegram user id (so your agent knows it’s you). Both are covered below, and the in-app wizard links here at each step.


Step 1 — Create your bot with BotFather

BotFather  is Telegram’s built-in tool for creating bots.

  1. In Telegram, open @BotFather  and tap Start.

  2. Send the command /newbot.

  3. When prompted, enter a display name (e.g. “My Cohort Agent”).

  4. Then enter a username — it must be unique and end in bot (e.g. my_cohort_bot).

  5. BotFather replies with your API token, which looks like:

    1234567890:<token-from-botfather>

Copy the whole token. Keep it secret — anyone with it can control your bot. If it ever leaks, send /revoke to BotFather to roll it.


Step 2 — Find your Telegram user id

Your agent answers only you, so Cohort needs your numeric Telegram user id (this is a number like 1534593841 — it’s not your @username).

  1. In Telegram, open @userinfobot  and tap Start.
  2. It replies immediately with your details, including a line like Id: 1534593841.
  3. Copy that number.

Step 3 — Connect in Cohort

  1. In Cohort, go to Settings → Channels and click Connect on Telegram.
  2. Follow the BotFather walkthrough (or skip it if you already have your token).
  3. Paste your bot token and your Telegram user id, then click Connect.
  4. When prompted, send your bot a message in Telegram (any message). Once your agent replies, the connection is confirmed.

That’s it — your agent is live in Telegram.


Using your agent in a group

Telegram bots have privacy mode on by default, which means a bot only sees messages that directly mention it or reply to it. That’s usually what you want in a group. If you want your agent to read all group messages:

  1. Message @BotFather , send /setprivacy, choose your bot, and select Disable.
  2. Remove and re-add the bot to the group — Telegram caches the privacy setting when the bot joins, so the change only takes effect after a rejoin.

(Alternatively, promote the bot to a group admin, which also lets it see all messages.)


Troubleshooting

The bot doesn’t reply.

  • Make sure you messaged the exact bot you just created — check the @username in your chat matches the one BotFather gave you.
  • Make sure the Telegram user id you entered is yours (the account you’re messaging from). Your agent ignores messages from anyone else. Re-check it with @userinfobot .
  • Give it a few seconds — Telegram can take a moment to deliver the first message.

“Bot token is invalid.”

  • Copy the entire token from BotFather (numeric id, a colon, then 35+ characters). If in doubt, send /token to BotFather to see it again.

It says the bot is already connected.

  • Each bot connects to one workspace at a time. Disconnect it from Settings → Channels first, then re-connect.

I want to start over.

  • Disconnect the channel in Settings → Channels, then run through the wizard again. To fully retire a bot, /revoke its token in BotFather.