Telegram Setup
Create and configure your Telegram bot for messaging
This guide walks you through creating a Telegram bot and connecting it to Zavu.
Step 1: Create a Bot with BotFather
- Open Telegram and search for @BotFather
- Start a conversation and send
/newbot - Follow the prompts to name your bot
- BotFather will give you a bot token like:
Code
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
Step 2: Configure in Zavu Dashboard
- Go to Senders in your Zavu dashboard
- Select your sender or create a new one
- In the Channels tab, click Add Telegram
- Paste your bot token
- Click Verify to confirm the bot is valid
- Click Save to complete setup
Step 3: Set Up Webhook (Automatic)
When you save your Telegram configuration, Zavu automatically:
- Registers your webhook URL with Telegram
- Starts receiving messages from your bot
No manual webhook configuration is needed.
Bot Commands (Optional)
You can configure bot commands via BotFather:
Code/setcommands
Then send a list of commands:
Codestart - Start the conversation help - Get help information
Testing Your Bot
Once configured, test your bot:
- Find your bot on Telegram by username
- Send a message to the bot
- Check your Zavu Inbox for the inbound message
- Reply from the Inbox or use the API
TypeScriptconst result = await zavu.messages.send({ to: "123456789", // Chat ID from inbound message text: "Thanks for reaching out!", channel: "telegram", });
Getting Chat IDs
Telegram chat IDs are obtained from inbound messages:
- When a user messages your bot, Zavu receives the message
- The
fromfield contains the user's chat ID - Store this ID to send future messages
Bot Privacy Mode
By default, bots only receive messages that:
- Are sent directly to the bot
- Start with
/(commands) in groups - Mention the bot in groups
To receive all messages in groups, disable privacy mode via BotFather:
Code/setprivacy
Troubleshooting
Bot token invalid
- Regenerate the token via BotFather using
/token - Make sure you copied the complete token
Messages not arriving
- Verify the bot is configured correctly in Zavu
- Check that the webhook is registered (automatic on save)
- Ensure the bot hasn't been blocked by the user
Can't message user
- Users must initiate contact first
- Check if the user blocked the bot
- Verify the chat ID is correct
Next Steps
- Telegram Overview - Learn about Telegram capabilities
- Webhooks - Configure webhook events