Telegram Integration
Configure Telegram bot integration for real-time emergency notifications in ISPBills.
ISPBills supports Telegram bot integration to deliver emergency notifications directly to your team. When critical events occur — such as server outages, mass disconnections, or billing failures — designated Telegram channels or groups receive instant alerts.
You will need a Telegram Bot Token before proceeding. Create one via BotFather on Telegram.
Overview
The Telegram integration is managed through two core components:
| Component | Purpose |
|---|---|
| TelegramEmergencyNotificationController | Manages notification rules, recipients, and alert types |
| TelegramWebhookHandler | Processes incoming webhook events from the Telegram API |
Emergency notifications ensure your operations team is immediately aware of issues that require urgent attention, reducing response times significantly.
Setting Up Telegram Bot
- Open Telegram and search for BotFather.
- Send
/newbotand follow the prompts to create a new bot. - Copy the API token provided by BotFather.
- In ISPBills, navigate to the Telegram integration settings page.
- Paste the bot token into the designated field and save.
Keep your bot token confidential. Anyone with access to the token can control the bot and read messages sent to it.
Configuring Emergency Notifications
Once the bot is connected, configure which events trigger notifications:
- Server Health Alerts — triggered when monitored infrastructure becomes unreachable.
- Billing Failures — triggered when payment processing encounters errors.
- Mass Disconnections — triggered when a threshold number of customers go offline simultaneously.
- Custom Alerts — define your own alert conditions based on system metrics.
For each alert type, you can specify the target Telegram chat (group or channel) and the severity level.
Webhook Setup
ISPBills uses webhooks to maintain a persistent connection with the Telegram API.
- Navigate to the webhook configuration section within the Telegram settings.
- The system will display your unique webhook URL.
- Register this URL with the Telegram API — ISPBills can do this automatically when you enable the integration.
- Verify the webhook status shows as Active.
If your ISPBills instance is behind a firewall or NAT, ensure the webhook URL is publicly accessible over HTTPS. Telegram will not deliver updates to non-HTTPS endpoints.
Testing Notifications
After completing the setup:
- Use the built-in test function to send a sample notification.
- Verify the message arrives in the configured Telegram chat.
- Check the notification log within ISPBills to confirm delivery status.
It is recommended to test notifications after any infrastructure changes such as domain or IP address updates.
If notifications are not arriving, verify:
- The bot has been added to the target group or channel.
- The bot has permission to send messages.
- The webhook URL is reachable from the public internet.
- The bot token has not been revoked or regenerated.