How It Works
The Telegram integration uses the Telegram Bot API to:- Connect your Telegram account via a bot command
- Send formatted text messages to your chat
- Deliver real-time notifications for all events
Telegram notifications are sent via a dedicated PingPilot bot directly to your private chat.
Prerequisites
Before setting up Telegram notifications, you need:- A Telegram account
- The Telegram app (mobile or desktop)
Setup Process
Find the PingPilot Bot
Search for the PingPilot bot in Telegram (the bot username will be provided in your dashboard)
Link Your Account
Send the following command to the bot:Replace
YOUR_API_KEY with your actual PingPilot API key.Linking Process Explained
When you send/start YOUR_API_KEY:
- The bot receives your message and extracts your Telegram Chat ID
- Your API key is validated against the PingPilot database
- Your Chat ID is stored and linked to your account
- Future notifications are sent to this Chat ID
src/app/api/telegram/route.ts:12:
Notification Format
Telegram notifications are sent as formatted text messages:- Event Category: With custom emoji from your category settings
- Description: Custom or default event description
- Color Code: Hex color for visual reference
- Timestamp: ISO 8601 formatted timestamp
- Custom Fields: All additional data you send with the event
Testing the Integration
After linking your account, test the integration:Technical Implementation
The Telegram integration uses the Telegram Bot API:src/lib/telegram.ts:9.
API Requirements
From the API handler (src/app/api/v1/event/route.ts:61):
Troubleshooting
Bot doesn't respond to /start
Bot doesn't respond to /start
Check the following:
- Make sure you’re sending the command in the correct format:
/start YOUR_API_KEY - Verify your API key is correct (copy it directly from the dashboard)
- Check if you’ve blocked the bot previously
- Try stopping and restarting the bot conversation
Not receiving notifications
Not receiving notifications
Verify:
- Your account is linked (you received the confirmation message)
- You haven’t blocked the PingPilot bot
- The bot has permission to send you messages
- Check your event delivery status in the dashboard
API returns 403 error
API returns 403 error
If you get:You haven’t linked your Telegram account. Complete the setup process with
/start YOUR_API_KEY.Cannot send messages to bot
Cannot send messages to bot
If you try to send any message other than The PingPilot bot only accepts the
/start:/start command for account linking. It’s designed to send notifications, not receive messages.Webhook Configuration
The PingPilot Telegram bot uses webhooks to receive messages. The webhook endpoint is:Users don’t need to configure webhooks manually. This is handled automatically by the PingPilot infrastructure.
Unlinking Your Account
To unlink your Telegram account:- Go to your PingPilot account settings
- Remove your Telegram username
- Block the PingPilot bot in Telegram (optional)
Next Steps
Discord Integration
Set up Discord notifications
Email Integration
Configure email notifications