โ๏ธ Telegram Quickstart
Create a Telegram bot and connect it to Infinibot in 3 minutes.
โก Quick Setup (3 minutes)
Step 1: Create Bot with BotFather
- Open Telegram and search for @BotFather
- Send
/newbot - Choose a name (display name, e.g., "My Assistant")
- Choose a username (must end in
bot, e.g.,myassistant_bot) - Copy the token BotFather gives you
It looks like: 123456789:ABCdefGHIjklMNOpqrsTUVwxyz
Step 2: Add Token to Infinibot
Option A: Environment variable
export TELEGRAM_BOT_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
Option B: Config file (~/.infinibot/config.json)
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
}
}
}
Step 3: Restart Gateway
infinibot gateway restart
Step 4: Message Your Bot! โ
Find your bot on Telegram and send a message.
First message triggers pairing - you'll get a code. Approve it:
infinibot pairing approve telegram <code>
๐ค BotFather Settings (Optional)
Customize your bot with these BotFather commands:
| Command | What it does |
|---|---|
/setdescription |
Bot description in profile |
/setabouttext |
"What can this bot do?" text |
/setuserpic |
Bot profile picture |
/setcommands |
Show commands in menu |
/setprivacy |
See all group messages (disable privacy) |
Enable group message visibility:
By default, bots only see messages that @mention them in groups.
To see all group messages:
- Message @BotFather
- Send
/setprivacy - Select your bot
- Choose Disable
โ ๏ธ After changing privacy, remove and re-add the bot to existing groups.
๐ฅ Groups Setup
Add your bot to a group, then configure:
{
"channels": {
"telegram": {
"groups": {
"*": {
"requireMention": true
}
}
}
}
}
Options:
requireMention: true- Bot only responds when @mentionedrequireMention: false- Bot responds to all messages
๐ Security: Who Can DM?
Pairing mode (default):
Unknown users get a code. Approve manually:
infinibot pairing list telegram
infinibot pairing approve telegram <code>
Allowlist mode:
Only specific users can DM:
{
"channels": {
"telegram": {
"dmPolicy": "allowlist",
"allowFrom": ["123456789"]
}
}
}
(Use Telegram user IDs - get yours from @userinfobot)
โ Verify Connection
# Check status
infinibot status
# Send a test message (use user ID or @username)
infinibot message send --channel telegram --target "123456789" --message "Hello!"
๐ ๏ธ Troubleshooting
Bot not responding
- Check gateway is running:
infinibot gateway status - Check token is valid:
infinibot status - Check pairing:
infinibot pairing list telegram
"Unauthorized" error
Your token is invalid or revoked. Get a new one from @BotFather.
Bot doesn't see group messages
- Check privacy mode:
/setprivacywith BotFather โ Disable - Remove and re-add bot to the group
- Or make the bot a group admin
Can't find user ID
Message @userinfobot on Telegram - it replies with your user ID.
๐ Full Documentation
For webhooks, multiple accounts, and advanced features: