Automating notifications through messenger bots streamlines development workflows, enabling instant alerts when builds complete, errors occur, or deployments finish. This guide provides step-by-step instructions for embedding bots that can send automated messages via webhooks across popular messaging platforms. Whether you need to notify your team about CI/CD pipeline results, server monitoring alerts, or any automated process completion, these integrations make it possible. We cover only platforms with straightforward bot integration capabilities - some secure messengers prioritize privacy over automation features and are intentionally excluded.
Content Table
- Understanding Webhook-Based Bot Automation
- Messenger Bot Integration Guides
- Discord Webhook Bot
- Slack Webhook Bot
- Microsoft Teams Webhook Bot
- Telegram Bot
- Mattermost Webhook Bot
- Matrix/Element Bot
- WhatsApp Business Bot
- Facebook Messenger Bot
- Messengers Without Easy Bot Support
- Practical Implementation Example
- Conclusion
- Frequently Asked Questions
Understanding Webhook-Based Bot Automation
Webhook-based bots operate on a simple principle: your application sends an HTTP POST request to a specific URL, and the messaging platform delivers that content to a channel or user. This architecture is ideal for automation scenarios like:
- Build notifications - Alert when compilation succeeds or fails with error details
- Deployment updates - Notify teams when code reaches staging or production
- Monitoring alerts - Send server health warnings or downtime notifications
- Scheduled reports - Deliver daily metrics or status summaries
The core workflow involves:
- Creating a bot or webhook URL on the target platform
- Configuring your automation tool (CI/CD, monitoring system, custom script) to send HTTP requests
- Formatting the message payload according to platform specifications
Understanding how different messenger platforms handle security and encryption is crucial for choosing the right platform for your notifications. For a deeper dive into platform-specific security considerations, see our Ultimate Guide about Messengers in 2026.
Messenger Bot Integration Guides
Below are step-by-step guides for each platform that supports easy webhook-based bot integration for sending automated messages.
Discord Webhook Bot
Discord offers one of the simplest webhook implementations, requiring no bot application or authentication tokens for basic message sending.
Step-by-Step Setup
- Open Server Settings - Right-click your server name and select "Server Settings"
- Navigate to Integrations - Click "Integrations" in the left sidebar
- Create Webhook - Click "Webhooks" then "New Webhook"
- Configure Webhook - Name your webhook (e.g., "Build Bot"), select the target channel, and optionally upload an avatar
- Copy Webhook URL - Click "Copy Webhook URL" and store it securely
Sending Messages via Webhook
curl -X POST -H "Content-Type: application/json" \
-d '{"content": "✅ Build completed successfully!\n\nProject: MyApp\nBranch: main\nDuration: 3m 42s"}' \
https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN
Rich Embed Example for Error Notifications
curl -X POST -H "Content-Type: application/json" \
-d '{
"embeds": [{
"title": "❌ Build Failed",
"color": 15158332,
"fields": [
{"name": "Project", "value": "MyApp", "inline": true},
{"name": "Branch", "value": "feature/login", "inline": true},
{"name": "Error", "value": "```TypeError: Cannot read property of undefined```"}
],
"timestamp": "2026-01-15T10:30:00.000Z"
}]
}' \
YOUR_WEBHOOK_URL
Official Documentation: Discord Webhook Documentation
Slack Webhook Bot
Slack provides Incoming Webhooks as part of their Slack Apps system, offering rich message formatting and channel flexibility.
Step-by-Step Setup
- Create Slack App - Visit api.slack.com/apps and click "Create New App"
- Choose Creation Method - Select "From scratch" and name your app (e.g., "CI/CD Notifications")
- Enable Incoming Webhooks - Navigate to "Incoming Webhooks" in the left sidebar and toggle it on
- Add Webhook to Workspace - Click "Add New Webhook to Workspace"
- Select Channel - Choose the channel where notifications should appear and click "Allow"
- Copy Webhook URL - Your unique webhook URL is now displayed
Sending Messages via Webhook
curl -X POST -H "Content-Type: application/json" \
-d '{"text": "✅ Deployment to production completed successfully!"}' \
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXX
Block Kit Message for Detailed Notifications
curl -X POST -H "Content-Type: application/json" \
-d '{
"blocks": [
{
"type": "header",
"text": {"type": "plain_text", "text": "🚨 Build Failed"}
},
{
"type": "section",
"fields": [
{"type": "mrkdwn", "text": "*Project:*\nMyApp"},
{"type": "mrkdwn", "text": "*Branch:*\nmain"},
{"type": "mrkdwn", "text": "*Error:*\n`Module not found`"}
]
}
]
}' \
YOUR_WEBHOOK_URL
Official Documentation: Slack Incoming Webhooks Guide
Microsoft Teams Webhook Bot
Microsoft Teams supports Incoming Webhooks for channel notifications, integrated through the connectors system.
Step-by-Step Setup
- Open Channel Settings - Navigate to the target channel, click the three dots (•••) next to the channel name
- Select Connectors - Click "Connectors" (or "Manage channel" then "Connectors" in newer versions)
- Find Incoming Webhook - Search for "Incoming Webhook" and click "Configure"
- Name Your Webhook - Provide a name (e.g., "Build Alerts") and optionally upload an image
- Create and Copy URL - Click "Create" and copy the webhook URL provided
Sending Messages via Webhook
curl -X POST -H "Content-Type: application/json" \
-d '{"text": "✅ Build #1234 completed successfully on main branch"}' \
YOUR_TEAMS_WEBHOOK_URL
Adaptive Card for Rich Notifications
curl -X POST -H "Content-Type: application/json" \
-d '{
"type": "message",
"attachments": [{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{"type": "TextBlock", "size": "Large", "weight": "Bolder", "text": "❌ Build Failed"},
{"type": "FactSet", "facts": [
{"title": "Project:", "value": "MyApp"},
{"title": "Error:", "value": "Compilation failed"}
]}
]
}
}]
}' \
YOUR_TEAMS_WEBHOOK_URL
Official Documentation: Microsoft Teams Incoming Webhooks
Telegram Bot
Telegram offers a powerful Bot API that allows sending messages programmatically. Unlike webhooks, you send requests directly to Telegram's API.
Step-by-Step Setup
- Create Bot via BotFather - Open Telegram and search for
@BotFather - Start New Bot - Send
/newbotcommand - Name Your Bot - Follow prompts to set display name and username (must end in "bot")
- Save API Token - BotFather provides an API token like
123456789:ABCdefGHIjklMNOpqrsTUVwxyz - Get Chat ID - Add the bot to your group/channel, send a message, then visit
https://api.telegram.org/bot<TOKEN>/getUpdatesto find the chat ID
Sending Messages via Bot API
curl -X POST \
"https://api.telegram.org/bot/sendMessage" \
-d "chat_id=" \
-d "text=✅ Build completed successfully!%0A%0AProject: MyApp%0ABranch: main" \
-d "parse_mode=HTML"
Formatted Message with HTML
curl -X POST \
"https://api.telegram.org/bot/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "",
"text": "❌ Build Failed\n\nProject: MyApp\nBranch: main\nError: Module not found",
"parse_mode": "HTML"
}'
Official Documentation: Telegram Bot API
Mattermost Webhook Bot
Mattermost is an open-source Slack alternative with excellent webhook support, ideal for self-hosted team communication.
Step-by-Step Setup
- Access Integrations - Click the hamburger menu, then "Integrations"
- Create Incoming Webhook - Select "Incoming Webhooks" then "Add Incoming Webhook"
- Configure Webhook - Set title, description, and select the default channel
- Save and Copy URL - Click "Save" and copy the webhook URL
Sending Messages via Webhook
curl -X POST -H "Content-Type: application/json" \
-d '{"text": "✅ Build completed successfully!"}' \
https://your-mattermost-server.com/hooks/YOUR_WEBHOOK_ID
Rich Attachment Message
curl -X POST -H "Content-Type: application/json" \
-d '{
"attachments": [{
"fallback": "Build Failed",
"color": "#FF0000",
"title": "❌ Build Failed",
"fields": [
{"short": true, "title": "Project", "value": "MyApp"},
{"short": true, "title": "Branch", "value": "main"},
{"short": false, "title": "Error", "value": "```Module not found```"}
]
}]
}' \
YOUR_WEBHOOK_URL
Official Documentation: Mattermost Incoming Webhooks
Matrix/Element Bot
Matrix is an open protocol for decentralized communication, with Element being the most popular client. Bot integration requires using the Matrix Client-Server API.
Step-by-Step Setup
- Create Bot Account - Register a new Matrix account for your bot on your homeserver or matrix.org
- Get Access Token - Log in and retrieve the access token from Element: Settings → Help & About → Advanced → Access Token
- Get Room ID - Join the target room with your bot, then find the room ID in Room Settings → Advanced
- Invite Bot to Room - Ensure the bot account has joined the room where you want to send messages
Sending Messages via Matrix API
curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"msgtype": "m.text", "body": "✅ Build completed successfully!"}' \
"https://matrix.org/_matrix/client/r0/rooms/YOUR_ROOM_ID/send/m.room.message/$(date +%s)"
Formatted Message with HTML
curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"msgtype": "m.text",
"body": "Build Failed\nProject: MyApp\nError: Module not found",
"format": "org.matrix.custom.html",
"formatted_body": "❌ Build Failed
Project: MyApp
Error: Module not found
"
}' \
"https://matrix.org/_matrix/client/r0/rooms/YOUR_ROOM_ID/send/m.room.message/$(date +%s)"
Tip: For easier Matrix bot development, consider using libraries like matrix-nio (Python) or matrix-bot-sdk (JavaScript).
Official Documentation: Matrix Client-Server API Specification
WhatsApp Business Bot
WhatsApp offers the Business API for automated messaging, though it requires business verification and has more complex setup than other platforms.
Step-by-Step Setup
- Create Meta Business Account - Visit business.facebook.com and create a business account
- Set Up WhatsApp Business - Navigate to developers.facebook.com, create an app, and add WhatsApp product
- Configure Phone Number - Add a phone number for your bot (test numbers available for development)
- Get Access Token - Generate a permanent access token from the app dashboard
- Verify Business - Complete business verification for production use
Sending Messages via Cloud API
curl -X POST \
"https://graph.facebook.com/v17.0/YOUR_PHONE_NUMBER_ID/messages" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "RECIPIENT_PHONE_NUMBER",
"type": "text",
"text": {"body": "✅ Build completed successfully!"}
}'
Important: WhatsApp requires message templates for initiating conversations with users. You can only send free-form messages within 24 hours of user interaction. For automated notifications, create and approve message templates first.
Official Documentation: WhatsApp Cloud API Documentation
Facebook Messenger Bot
Facebook Messenger bots require a Facebook App and Page, with messages sent through the Send API.
Step-by-Step Setup
- Create Facebook App - Visit developers.facebook.com and create a new app (select "Business" type)
- Add Messenger Product - In your app dashboard, click "Add Product" and select Messenger
- Connect Facebook Page - Link a Facebook Page to your app (create one if needed)
- Generate Page Access Token - In Messenger settings, generate a token for your page
- Get PSID - Users must message your page first; capture their Page-Scoped ID (PSID) from webhook events
Sending Messages via Send API
curl -X POST \
"https://graph.facebook.com/v17.0/me/messages" \
-H "Content-Type: application/json" \
-d '{
"recipient": {"id": "USER_PSID"},
"message": {"text": "✅ Build completed successfully!"},
"access_token": "YOUR_PAGE_ACCESS_TOKEN"
}'
Note: Facebook Messenger has strict policies about automated messaging. Bots can only send promotional messages within 24 hours of user interaction. For notifications outside this window, you need to apply for specific message tags or use the one-time notification feature.
Official Documentation: Facebook Messenger Platform Documentation
Messengers Without Easy Bot Support
The following messengers prioritize privacy and security over automation features, making webhook-based bot integration either impossible or impractical:
- Signal - No official bot API. Signal prioritizes end-to-end encryption and user privacy, deliberately avoiding automation features that could compromise security.
- Session - Decentralized messenger without bot infrastructure. The onion routing architecture makes automated messaging impractical.
- Briar - Peer-to-peer messenger designed for activists and journalists. No server infrastructure means no webhook capability.
- Wire - While Wire has some enterprise API features, there's no simple webhook system for automated notifications.
- Wickr - Enterprise-focused with no public bot API. Automation requires Wickr Enterprise with custom integration.
- SimpleX - Privacy-first design without user identifiers makes bot integration architecturally incompatible.
- Threema - Offers Threema Gateway for businesses, but it's a paid service requiring contracts, not a simple webhook setup.
- Viber - Has a bot API but requires business account approval and is primarily designed for customer service, not developer notifications.
- LINE - Offers Messaging API but requires business account verification and is complex for simple notification use cases.
- WeChat - Official Account API exists but requires Chinese business registration and government approval.
For secure communication needs where these platforms are preferred, consider using them alongside a supported platform for automation, or explore our guide on keeping private messages truly secure.
Practical Implementation Example
Here's a complete Node.js example that sends build notifications to multiple platforms simultaneously:
const axios = require('axios');
const notifiers = {
discord: async (message, webhookUrl) => {
await axios.post(webhookUrl, { content: message });
},
slack: async (message, webhookUrl) => {
await axios.post(webhookUrl, { text: message });
},
telegram: async (message, token, chatId) => {
await axios.post(`https://api.telegram.org/bot${token}/sendMessage`, {
chat_id: chatId,
text: message,
parse_mode: 'HTML'
});
},
teams: async (message, webhookUrl) => {
await axios.post(webhookUrl, { text: message });
}
};
async function notifyBuildResult(success, project, branch, error = null) {
const emoji = success ? '✅' : '❌';
const status = success ? 'succeeded' : 'failed';
let message = `${emoji} Build ${status}\n\nProject: ${project}\nBranch: ${branch}`;
if (error) message += `\nError: ${error}`;
const notifications = [
notifiers.discord(message, process.env.DISCORD_WEBHOOK),
notifiers.slack(message, process.env.SLACK_WEBHOOK),
notifiers.telegram(message, process.env.TELEGRAM_TOKEN, process.env.TELEGRAM_CHAT_ID),
notifiers.teams(message, process.env.TEAMS_WEBHOOK)
];
await Promise.allSettled(notifications);
}
// Usage in your CI/CD pipeline
notifyBuildResult(false, 'MyApp', 'main', 'Module not found: @utils/helper');
Key Takeaways:
- Discord, Slack, and Mattermost offer the simplest webhook setup - just create and use a URL
- Telegram requires a bot token and chat ID but offers excellent reliability and formatting
- Microsoft Teams uses Adaptive Cards for rich notifications
- Matrix/Element requires more setup but works great for self-hosted environments
- WhatsApp and Facebook Messenger have stricter requirements and messaging policies
- Privacy-focused messengers intentionally lack bot APIs to protect user security
Conclusion
Implementing webhook-based bot notifications across messenger platforms enables powerful automation for development workflows. Discord and Slack offer the lowest barrier to entry with simple webhook URLs, while Telegram provides excellent reliability with minimal setup. For enterprise environments, Microsoft Teams and Mattermost integrate well with existing infrastructure. Matrix offers a self-hosted, privacy-respecting option with full API access.
Start with one platform, validate your notification workflow, then expand to additional channels as needed. The code examples provided work immediately - your next step is to create a webhook on your preferred platform and send your first automated message within the next 10 minutes.
Frequently Asked Questions
Discord offers the simplest setup - create a webhook in channel settings and you immediately have a URL to POST messages to. No authentication tokens, no app creation, no verification required. Slack is similarly easy but requires creating a Slack App first.
No, privacy-focused messengers like Signal, Session, Briar, and SimpleX deliberately avoid bot APIs to protect user privacy. These platforms prioritize end-to-end encryption and minimal metadata collection, which conflicts with automated messaging infrastructure. For notifications, use a supported platform alongside your secure messenger for private conversations.
Webhook URLs should be treated as secrets - anyone with the URL can send messages to your channel. Store them in environment variables, never commit them to version control, and rotate them if compromised. Some platforms like Slack allow you to regenerate webhook URLs if needed.
Webhooks are one-way: you send a message to a URL and it appears in a channel. Bot APIs are bidirectional: you can send messages AND receive/respond to user messages. For simple notifications (build alerts, monitoring), webhooks are sufficient. For interactive bots that respond to user commands, you need the full bot API with a webhook endpoint on your server.
Most platforms have rate limits: Discord allows 30 messages per minute per webhook, Slack has similar limits. Implement message queuing with exponential backoff for retries. For high-volume scenarios, batch multiple events into single messages or use platform-specific bulk APIs where available.