Telegram Bot Setup

Connect your NeuroGen AI agent to Telegram in minutes. Your bot will be able to chat with users, answer questions, and leverage all the capabilities of your AI agent.


Prerequisites

Before you begin, make sure you have: - A NeuroGen account with an AI agent created - A Telegram account - A device with Telegram installed


Step 1: Create Your Bot with BotFather

  1. Open Telegram and search for @BotFather or click t.me/BotFather

  2. Start a chat with BotFather and send the command: /newbot

  3. Choose a display name for your bot (e.g., "My AI Assistant")

  4. This is what users will see in their chat list

  5. Choose a username for your bot

  6. Must end in bot (e.g., myai_assistant_bot)
  7. This is how users will find your bot

  8. Copy your bot token

  9. BotFather will send you a message with your token
  10. It looks like: 7123456789:AAHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  11. Keep this token secret! Anyone with the token can control your bot

Step 2: Connect to NeuroGen

  1. Go to Dashboard > Integrations

  2. Click the Telegram button

  3. Paste your bot token in the token field

  4. Select an AI agent to power your bot

  5. Choose from your existing agents or create a new one

  6. (Optional) Customize the Welcome Message

  7. This is sent when users start chatting with /start
  8. Default: "Hello! I'm your AI assistant. How can I help you today?"

  9. (Optional) Customize the Help Message

  10. This is sent when users use /help

  11. Click Connect Telegram Bot


Step 3: Start Chatting

  1. In Telegram, search for your bot by its username (e.g., @myai_assistant_bot)

  2. Click Start or send /start

  3. Start chatting! Your AI agent will respond to messages.


Bot Commands

Command Description
/start Start conversation and see welcome message
/help Show help information
/reset Clear conversation history and start fresh

Features

Conversation Memory

Your bot remembers the conversation context within a session. Use /reset to clear history and start fresh.

Rate Limiting

To prevent abuse, there's a limit of 10 messages per minute and 60 messages per hour per user.

Credit Usage

Messages are billed based on the AI model your agent uses. Monitor usage in the Integrations dashboard.


Troubleshooting

Bot Not Responding

  1. Check the token - Make sure you copied the entire token correctly
  2. Verify the agent - Ensure your agent is active and properly configured
  3. Check your credits - Make sure you have sufficient credits in your account

"Rate Limit Exceeded"

Wait a moment before sending more messages. The limit is 10 messages per minute.

"Insufficient Credits"

Add more credits to your NeuroGen account to continue using the bot.

Bot Appears Offline

Telegram bots don't show online status like regular users. The bot will respond when you send a message.


Security Notes

  • Never share your bot token - Anyone with the token can control your bot
  • Bot tokens are encrypted when stored in NeuroGen
  • You can revoke and regenerate tokens in BotFather using /revoke
  • Delete the integration from NeuroGen if you suspect the token is compromised

Managing Your Bot

Update Settings

Go to Dashboard > Integrations and click on your Telegram bot to update: - Connected agent - Welcome/help messages - View usage statistics

Disconnect Bot

Click the Disconnect button to remove the integration. This stops the bot from responding but doesn't delete the bot from Telegram.

Delete Bot Entirely

To delete the bot from Telegram: 1. Open BotFather 2. Send /deletebot 3. Select your bot 4. Confirm deletion


Next Steps


Need help? Contact support@neurogen.cc

Connecting