Skip to main content

Telegram

Prefer guided AI setup?

Instead of following these steps manually, you can use the AI Credential Assistant — describe what you want to connect and the AI will walk you through the setup step by step, tailored to your account.

Overview​

Connect your Telegram bot to Nirvai to send messages, manage groups, and automate interactions through the Telegram Bot API.

Supported Authentication Methods​

  • Bot Token - Token provided by BotFather

Prerequisites​

  • A Telegram account
  • Access to Telegram (mobile app or desktop)

Setup Instructions​

Creating a Telegram Bot​

  1. Open Telegram and search for @BotFather
  2. Start a chat with BotFather
  3. Send the /newbot command
  4. Follow the prompts:
    • Enter a display name for your bot (e.g., "My Nirvai Bot")
    • Enter a username for your bot (must end in bot, e.g., "mynirvai_bot")
  5. BotFather will respond with your bot token in this format:
    123456789:ABCdefGhIJKlmnoPQRstUVwxYZ
  6. Copy this token
  7. In Nirvai, create a new Telegram credential and paste the token

Getting an Existing Bot Token​

If you already have a bot:

  1. Open a chat with @BotFather
  2. Send /mybots
  3. Select your bot
  4. Click API Token to view/regenerate the token

Bot Configuration (Optional)​

After creating your bot, you can configure it via BotFather:

CommandDescription
/setdescriptionSet the bot's description
/setabouttextSet the bot's About info
/setuserpicSet the bot's profile picture
/setcommandsDefine bot commands
/setprivacyToggle group privacy mode

Troubleshooting​

Common Issues​

  • 401 Unauthorized: Token is invalid or was revoked. Get a new token from BotFather.
  • Bot not responding: Ensure the bot is not blocked by the user.
  • Can't send to group: Bot needs to be added to the group first.
  • Privacy mode: By default, bots only see messages that start with / in groups. Disable privacy mode via BotFather if needed.

Token Security​

  • Never share your bot token publicly
  • If compromised, use /revoke in BotFather to generate a new token
  • The old token will immediately stop working

Adapted for Nirvai platform


Next Steps​

Got your credential? Connect it to an agent

Use the AI Tool Creator to turn this credential into agent-callable tools. Describe what your agent should be able to do and the AI investigates the API, configures the endpoints, and gives you a reviewable toolkit before saving anything.