Telegram Integration
Receive Nadi alerts via Telegram.
Setup
1. Create a Bot
- Open Telegram and search for @BotFather
- Send
/newbot - Follow prompts to name your bot
- Copy the bot token
2. Get Chat ID
For Personal Alerts
- Send a message to your bot
- Visit:
https://api.telegram.org/bot<TOKEN>/getUpdates - Find your
chat_idin the response
For Group Alerts
- Add the bot to your group
- Send a message in the group mentioning the bot
- Visit:
https://api.telegram.org/bot<TOKEN>/getUpdates - Find the group
chat_id(negative number)
3. Add to Nadi
- Go to Settings → Integrations
- Click Add Telegram
- Enter bot token
- Enter chat ID
- Click Save
4. Test
Click Test to send a test message.
Notification Format
Standard Alert
🔴 New Error in my-app
TypeError: Cannot read property 'name' of undefined
📍 app/services/UserService.php:45
📊 23 events | 12 users
🌍 production
🔗 View: https://nadi.pro/issues/abc123With Context
🔴 New Error in my-app
TypeError: Cannot read property 'name' of undefined
📍 Location: app/services/UserService.php:45
👤 User: [email protected]
🏷️ Tags: checkout, payment
📊 Events: 23
👥 Users: 12
🕐 First seen: 2 hours ago
🔗 https://nadi.pro/issues/abc123Features
Inline Actions
Commands to interact with alerts:
/resolve abc123- Resolve issue/ignore abc123- Ignore issue/status- View current status
Bot Commands
| Command | Description |
|---|---|
/start | Initialize bot |
/status | Current error summary |
/recent | Recent issues |
/help | Available commands |
Formatting
Nadi uses Telegram's Markdown for formatting:
- Bold for emphasis
Codefor technical terms- Links to dashboard
Configuration
Multiple Recipients
Send to multiple chats:
yaml
actions:
- channel: telegram
target: "123456789" # Personal
- channel: telegram
target: "-987654321" # GroupSeverity-Based Routing
yaml
# Critical to on-call person
name: Critical Alerts
conditions:
levels: [fatal]
actions:
- channel: telegram
target: "oncall_chat_id"
# Others to group
name: Team Alerts
conditions:
levels: [error]
actions:
- channel: telegram
target: "group_chat_id"Quiet Hours
Respect quiet hours:
yaml
schedule:
type: hours
hours:
start: "08:00"
end: "22:00"
timezone: "Europe/London"Group Setup
Adding Bot to Group
- Create a Telegram group
- Add your Nadi bot
- Give admin rights (optional, for features)
- Note the group chat ID
Admin Rights
For full features, give bot admin rights:
- Pin messages (for critical alerts)
- Edit messages (for updates)
Security
Bot Token
- Keep token secret
- Rotate if compromised
- Use environment variables
Chat IDs
- Verify chat IDs belong to you
- Group IDs start with
- - Don't share chat IDs publicly
Troubleshooting
Bot Not Sending
- Verify bot token is correct
- Check chat ID is correct
- Ensure bot can message the chat
- Test with curl:bash
curl -X POST \ "https://api.telegram.org/bot<TOKEN>/sendMessage" \ -d "chat_id=<CHAT_ID>&text=Test"
Can't Find Chat ID
- Send message to bot (or mention in group)
- Check getUpdates within 24 hours
- Try using @RawDataBot to get ID
Group Not Receiving
- Ensure bot is in the group
- Check group permissions allow bots
- Verify group chat ID (should be negative)
Best Practices
Channel Organization
| Chat | Purpose |
|---|---|
| Personal | On-call alerts |
| Team Group | General alerts |
| Ops Channel | Critical only |
Alert Hygiene
- Don't over-alert
- Use severity filters
- Leverage quiet hours
- Consider digest mode
Next Steps
- Alert Rules - Configure rules
- Slack - Slack integration
- Webhooks - Custom integrations