Follow these steps to connect PulseBot to Telegram.
- PulseBot installed and configured
- Timeplus running
- A Telegram account
- Open Telegram and search for @BotFather
- Start a chat and send
/newbot - Follow the prompts:
- Enter a name for your bot (e.g., "My PulseBot")
- Enter a username for your bot (must end in
bot, e.g., "my_pulsebot")
- BotFather will give you a bot token like:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz - Save this token securely - you'll need it in Step 3
If you want to restrict the bot to specific users only:
- Search for @userinfobot on Telegram
- Start a chat and it will show your user ID (a number like
123456789) - Note down the user IDs of all allowed users
Note: Skip this step if you want the bot to respond to everyone.
export TELEGRAM_BOT_TOKEN="your_bot_token_here"Or add it to your .env file:
TELEGRAM_BOT_TOKEN=your_bot_token_here
channels:
telegram:
enabled: true
token: "${TELEGRAM_BOT_TOKEN}"
allow_from: [] # Empty = allow all usersTo restrict to specific users, add their Telegram user IDs (as integers):
channels:
telegram:
enabled: true
token: "${TELEGRAM_BOT_TOKEN}"
allow_from:
- 123456789
- 987654321Start the agent to begin processing messages:
pulsebot runThe agent will automatically:
- Connect to Telegram using your bot token
- Listen for incoming messages
- Process them through the AI agent
- Send responses back to users
- Open Telegram and search for your bot by its username
- Click Start or send
/start - Send a message like "Hello, what can you do?"
- Wait for the response from PulseBot
| Command | Description |
|---|---|
/start |
Start the bot and see welcome message |
/help |
Show help information |
| Issue | Possible Cause | Solution |
|---|---|---|
| Bot not responding | Agent not running | Ensure pulsebot run is running |
| "Not authorized" message | User ID not in allow list | Add your user ID to allow_from in config |
| Token invalid error | Incorrect token | Check the token is correct with no extra spaces |
| No response from agent | Timeplus not running | Ensure Timeplus/Proton is running |
| Connection timeout | Network issues | Check your internet connection |
View agent logs for debugging:
pulsebot run --log-level DEBUG- Restrict Users: Always set
allow_fromin production to prevent unauthorized access - Protect Token: Never commit your bot token to version control
- Use Environment Variables: Store sensitive values in environment variables, not directly in config files
When using Telegram:
Telegram User
│
▼
Telegram Bot API
│
▼
TelegramChannel (PulseBot)
│
▼ writes user_input
messages stream (Timeplus)
│
▼ reads user_input
Agent Core
│
▼ writes agent_response
messages stream (Timeplus)
│
▼ reads agent_response
TelegramChannel (PulseBot)
│
▼
Telegram Bot API
│
▼
Telegram User