OpenClaw transforms chat platforms into powerful automation interfaces. Instead of switching between apps, teams execute workflows, access data, and manage projects directly from Slack, Discord, or Telegram conversations.
This guide covers complete integration setup, from bot creation to advanced workflow deployment across all three platforms.
Integration Architecture Overview
How OpenClaw Chat Integrations Work
Bidirectional Communication:
graph LR
A[Chat Platform] <--> B[OpenClaw Gateway]
B <--> C[Skills Engine]
C <--> D[External APIs]
D --> E[Business Systems]
OpenClaw doesn't just send messages to chat platforms — it creates intelligent interfaces where natural language commands trigger complex business workflows.
Core Integration Components:
- Bot Authentication: Secure connection between OpenClaw and platform
- Message Processing: Natural language command interpretation
- Skill Execution: Business logic processing and external system calls
- Response Formatting: Platform-specific message rendering
- Event Handling: Proactive notifications and scheduled updates
Multi-Platform Strategy
Platform-Specific Strengths:
- Slack: Enterprise workflows, thread-based discussions, app ecosystem
- Discord: Community management, voice channels, gaming-style interactions
- Telegram: Mobile-first automation, inline keyboards, cross-platform sync
Unified Skill Development:
# Single skill works across all platforms
class ProjectStatusSkill(Skill):
"""Get project status across platforms"""
async def execute(self, project_id=None, **kwargs):
# Platform-agnostic business logic
status = await self.get_project_status(project_id)
# Platform-specific formatting
platform = self.get_current_platform()
if platform == 'slack':
return self.format_slack_blocks(status)
elif platform == 'discord':
return self.format_discord_embed(status)
elif platform == 'telegram':
return self.format_telegram_keyboard(status)
Slack Integration Setup
Step 1: Create Slack Application
Bot Configuration:
- Visit Slack API Console
- Create new app "OpenClaw Assistant"
- Configure OAuth & Permissions
Required Scopes:
# OAuth scopes for OpenClaw Slack bot
oauth_scopes:
bot:
- "app_mentions:read" # Respond to @mentions
- "channels:history" # Read channel messages
- "channels:read" # List channels
- "chat:write" # Send messages
- "commands" # Handle slash commands
- "files:write" # Upload files and documents
- "groups:history" # Read private channel history
- "groups:read" # List private channels
- "im:history" # Read DM history
- "im:read" # List DMs
- "im:write" # Send DMs
- "reactions:write" # Add emoji reactions
- "users:read" # Read user information
- "workflow.steps:execute" # Execute workflow steps
user:
- "files:read" # Access user files
- "search:read" # Search workspace content
Event Subscriptions:
{
"events": {
"app_mention": "Handle @openclaw mentions",
"message.channels": "Process channel messages with triggers",
"message.groups": "Process private channel messages",
"message.im": "Handle direct messages",
"reaction_added": "Process emoji reactions as commands",
"workflow_step_execute": "Execute custom workflow steps"
},
"request_url": "https://your-openclaw-instance.com/webhooks/slack"
}
Step 2: OpenClaw Slack Configuration
Environment Setup:
# Slack integration credentials
cat >> ~/.openclaw/.env << 'EOF'
# Slack Integration
SLACK_BOT_TOKEN=xoxb-your-bot-token-here
SLACK_APP_TOKEN=xapp-your-app-token-here
SLACK_SIGNING_SECRET=your-signing-secret
SLACK_CLIENT_ID=your-client-id
SLACK_CLIENT_SECRET=your-client-secret
EOF
Integration Configuration:
# ~/.openclaw/integrations/slack.yaml
slack:
enabled: true
bot_token: ${SLACK_BOT_TOKEN}
app_token: ${SLACK_APP_TOKEN}
signing_secret: ${SLACK_SIGNING_SECRET}
# Behavior configuration
settings:
respond_to_mentions: true
respond_to_dms: true
enable_slash_commands: true
enable_interactive_components: true
enable_workflow_steps: true
# Command prefixes
triggers:
- "/openclaw"
- "@openclaw"
- "oc:" # Quick prefix for commands
# Default channels for notifications
channels:
alerts: "#alerts"
reports: "#daily-reports"
errors: "#tech-alerts"
Step 3: Slack-Specific Skills
Slack Message Management:
class SlackThreadSkill(Skill):
"""Manage Slack threads and conversations"""
async def execute(self, action, thread_id=None, **kwargs):
slack = self.agent.get_integration('slack')
if action == "summarize":
# Get thread messages
messages = await slack.get_thread_messages(thread_id)
# AI-powered summarization
summary = await self.generate_thread_summary(messages)
# Post summary with formatting
await slack.post_message(
channel=messages[0]['channel'],
thread_ts=thread_id,
blocks=[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": f"*Thread Summary:*\n{summary}"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {"type": "plain_text", "text": "📋 Create Task"},
"action_id": "create_task_from_thread"
}
]
}
]
)
elif action == "create_task":
# Extract action items from thread
tasks = await self.extract_action_items(thread_id)
# Create tasks in project management system
for task in tasks:
await self.create_project_task(task)
return {"status": "completed", "action": action}
Slack Workflow Integration:
class SlackWorkflowSkill(Skill):
"""Custom Slack workflow steps"""
async def handle_workflow_step(self, step_data):
"""Process Slack workflow step execution"""
inputs = step_data.get('inputs', {})
if step_data['callback_id'] == 'openclaw_data_lookup':
# Look up data from external systems
result = await self.lookup_customer_data(inputs['customer_id'])
# Return data to Slack workflow
await self.complete_workflow_step(step_data['workflow_step'], {
'customer_name': result['name'],
'account_status': result['status'],
'last_contact': result['last_contact']
})
elif step_data['callback_id'] == 'openclaw_approval_request':
# Create approval request
await self.create_approval_request(inputs)
Discord Integration Setup
Step 1: Discord Bot Creation
Bot Setup Process:
- Visit Discord Developer Portal
- Create new application "OpenClaw Assistant"
- Navigate to Bot section
- Configure bot permissions and intents
Required Bot Permissions:
# Discord bot permissions (integer: 8589934592)
permissions:
text_permissions:
- "send_messages"
- "embed_links"
- "attach_files"
- "read_message_history"
- "use_slash_commands"
- "manage_messages" # For cleanup and moderation
- "add_reactions" # For interactive commands
voice_permissions:
- "connect" # Join voice channels
- "speak" # Text-to-speech capabilities
general_permissions:
- "view_channels" # See channels and categories
- "manage_roles" # For auto-role assignment
- "manage_channels" # For temporary channel creation
Gateway Intents:
# Discord intents configuration
import discord
intents = discord.Intents.default()
intents.message_content = True # Required for message processing
intents.guilds = True # Guild events
intents.guild_messages = True # Message events
intents.guild_reactions = True # Reaction events
intents.voice_states = True # Voice channel monitoring
Step 2: OpenClaw Discord Configuration
Environment Variables:
# Discord integration credentials
cat >> ~/.openclaw/.env << 'EOF'
# Discord Integration
DISCORD_BOT_TOKEN=your-bot-token-here
DISCORD_APPLICATION_ID=your-application-id
DISCORD_CLIENT_SECRET=your-client-secret
EOF
Discord Integration Config:
# ~/.openclaw/integrations/discord.yaml
discord:
enabled: true
bot_token: ${DISCORD_BOT_TOKEN}
application_id: ${DISCORD_APPLICATION_ID}
settings:
command_prefix: "!"
respond_to_mentions: true
respond_to_dms: true
enable_slash_commands: true
enable_context_menus: true
# Auto-sync slash commands
sync_commands: true
# Guild-specific settings
guilds:
default:
admin_roles: ["Admin", "Moderator"]
allowed_channels: ["#bot-commands", "#automation"]
restricted_skills: ["admin_*", "mod_*"]
Step 3: Discord-Specific Features
Slash Command Registration:
class DiscordIntegration:
"""Discord-specific OpenClaw integration"""
async def register_slash_commands(self):
"""Register slash commands with Discord"""
commands = [
{
"name": "project",
"description": "Project management commands",
"options": [
{
"name": "status",
"description": "Get project status",
"type": 1, # Subcommand
"options": [
{
"name": "project_id",
"description": "Project identifier",
"type": 3, # String
"required": True
}
]
}
]
},
{
"name": "remind",
"description": "Set a reminder",
"options": [
{
"name": "message",
"description": "Reminder message",
"type": 3, # String
"required": True
},
{
"name": "time",
"description": "When to remind (e.g., '2 hours', 'tomorrow 9am')",
"type": 3, # String
"required": True
}
]
}
]
await self.sync_global_commands(commands)
class DiscordReminderSkill(Skill):
"""Discord reminder management"""
async def execute(self, message, time_str, user_id, channel_id):
# Parse time string
remind_time = await self.parse_time_string(time_str)
# Schedule reminder
reminder_id = await self.schedule_reminder({
'user_id': user_id,
'channel_id': channel_id,
'message': message,
'remind_at': remind_time
})
# Immediate confirmation
await self.send_discord_response({
"type": 4, # Channel message with source
"data": {
"embeds": [
{
"title": "⏰ Reminder Set",
"description": f"I'll remind you about: {message}",
"fields": [
{
"name": "When",
"value": f"<t:{int(remind_time.timestamp())}:F>",
"inline": True
}
],
"color": 0x00ff00
}
]
}
})
Discord Embed Formatting:
class DiscordFormattingSkill(Skill):
"""Rich Discord message formatting"""
def format_project_status(self, project_data):
"""Format project status as Discord embed"""
status_color = {
'on_track': 0x00ff00, # Green
'at_risk': 0xffff00, # Yellow
'delayed': 0xff0000 # Red
}
embed = {
"title": f"📊 Project: {project_data['name']}",
"description": project_data['description'],
"color": status_color.get(project_data['status'], 0x808080),
"fields": [
{
"name": "📅 Timeline",
"value": f"**Start:** {project_data['start_date']}\n**Due:** {project_data['due_date']}",
"inline": True
},
{
"name": "👥 Team",
"value": f"**Lead:** {project_data['lead']}\n**Members:** {len(project_data['members'])}",
"inline": True
},
{
"name": "📈 Progress",
"value": f"**Completed:** {project_data['completion']}%\n**Tasks:** {project_data['completed_tasks']}/{project_data['total_tasks']}",
"inline": False
}
],
"footer": {
"text": f"Last updated: {project_data['last_updated']}",
"icon_url": "https://openclaw.ai/icons/project.png"
}
}
return {"embeds": [embed]}
Telegram Integration Setup
Step 1: Create Telegram Bot
Bot Creation Process:
- Message @BotFather on Telegram
- Use
/newbotcommand - Choose bot name and username
- Save bot token securely
Bot Configuration Commands:
# Configure bot settings via BotFather
/setdescription - Set OpenClaw AI Assistant description
/setabouttext - Add about text with capabilities
/setuserpic - Upload OpenClaw logo
/setcommands - Define command list
# Command list for BotFather
project - Manage projects and tasks
remind - Set reminders and notifications
status - Check system and integration status
help - Get help with OpenClaw commands
settings - Configure personal preferences
Step 2: OpenClaw Telegram Configuration
Environment Setup:
# Telegram integration credentials
cat >> ~/.openclaw/.env << 'EOF'
# Telegram Integration
TELEGRAM_BOT_TOKEN=your-bot-token-here
TELEGRAM_WEBHOOK_SECRET=your-webhook-secret
EOF
Telegram Configuration:
# ~/.openclaw/integrations/telegram.yaml
telegram:
enabled: true
bot_token: ${TELEGRAM_BOT_TOKEN}
webhook_secret: ${TELEGRAM_WEBHOOK_SECRET}
settings:
webhook_url: "https://your-openclaw-instance.com/webhooks/telegram"
max_connections: 40
allowed_updates: ["message", "callback_query", "inline_query"]
# Bot behavior
behavior:
parse_mode: "MarkdownV2" # or "HTML"
disable_web_page_preview: true
allow_sending_without_reply: true
# Rate limiting
rate_limits:
messages_per_second: 30
messages_per_minute: 20
messages_per_hour: 1000
Step 3: Telegram-Specific Features
Inline Keyboards and Callbacks:
class TelegramProjectSkill(Skill):
"""Telegram project management with inline keyboards"""
async def execute(self, command, chat_id, message_id=None, **kwargs):
telegram = self.agent.get_integration('telegram')
if command == "list_projects":
projects = await self.get_user_projects(chat_id)
keyboard = []
for project in projects:
keyboard.append([{
"text": f"📊 {project['name']}",
"callback_data": f"project_detail:{project['id']}"
}])
keyboard.append([{
"text": "➕ New Project",
"callback_data": "project_create"
}])
await telegram.send_message(
chat_id=chat_id,
text="*Your Projects:*\nSelect a project to view details or create a new one\\.",
parse_mode="MarkdownV2",
reply_markup={
"inline_keyboard": keyboard
}
)
elif command == "project_detail":
project_id = kwargs.get('project_id')
project = await self.get_project_details(project_id)
detail_text = f"""
*📊 {project['name']}*
📝 *Description:* {project['description']}
📅 *Due Date:* {project['due_date']}
📈 *Progress:* {project['completion']}%
👥 *Team Size:* {len(project['members'])} members
*Recent Activity:*
{self.format_recent_activity(project['activity'])}
"""
keyboard = [
[
{"text": "📋 Tasks", "callback_data": f"tasks:{project_id}"},
{"text": "👥 Team", "callback_data": f"team:{project_id}"}
],
[
{"text": "📊 Reports", "callback_data": f"reports:{project_id}"},
{"text": "⚙️ Settings", "callback_data": f"settings:{project_id}"}
],
[
{"text": "🔙 Back to Projects", "callback_data": "list_projects"}
]
]
await telegram.edit_message_text(
chat_id=chat_id,
message_id=message_id,
text=detail_text,
parse_mode="MarkdownV2",
reply_markup={"inline_keyboard": keyboard}
)
Telegram File Handling:
class TelegramFileSkill(Skill):
"""Handle file uploads and downloads via Telegram"""
async def handle_document(self, file_data, chat_id):
"""Process uploaded documents"""
telegram = self.agent.get_integration('telegram')
# Download file from Telegram
file_info = await telegram.get_file(file_data['file_id'])
file_content = await telegram.download_file(file_info['file_path'])
# Process based on file type
if file_data['mime_type'] == 'application/pdf':
# Extract text from PDF
text = await self.extract_pdf_text(file_content)
summary = await self.summarize_document(text)
await telegram.send_message(
chat_id=chat_id,
text=f"📄 *Document Summary:*\n\n{summary}",
parse_mode="MarkdownV2"
)
elif file_data['mime_type'].startswith('image/'):
# Process image with OCR
text = await self.extract_image_text(file_content)
if text:
await telegram.send_message(
chat_id=chat_id,
text=f"🔍 *Extracted Text:*\n\n```\n{text}\n```",
parse_mode="MarkdownV2"
)
Cross-Platform Workflow Examples
Multi-Platform Notification System
Unified Notification Skill:
class CrossPlatformNotificationSkill(Skill):
"""Send notifications across all platforms"""
async def execute(self, message, urgency="normal", channels=None):
# Determine target channels based on urgency
if channels is None:
channels = self.get_default_channels(urgency)
tasks = []
# Slack notifications
if 'slack' in channels:
tasks.append(self.send_slack_notification(
message, urgency, channels['slack']
))
# Discord notifications
if 'discord' in channels:
tasks.append(self.send_discord_notification(
message, urgency, channels['discord']
))
# Telegram notifications
if 'telegram' in channels:
tasks.append(self.send_telegram_notification(
message, urgency, channels['telegram']
))
# Send all notifications concurrently
results = await asyncio.gather(*tasks, return_exceptions=True)
return {
'sent_count': len([r for r in results if not isinstance(r, Exception)]),
'failed_count': len([r for r in results if isinstance(r, Exception)]),
'channels': channels
}
def get_default_channels(self, urgency):
"""Get appropriate channels based on urgency level"""
channel_map = {
'critical': {
'slack': '#critical-alerts',
'discord': 'general',
'telegram': '@all'
},
'high': {
'slack': '#alerts',
'discord': 'notifications',
'telegram': '@team'
},
'normal': {
'slack': '#updates',
'discord': 'updates',
'telegram': '@updates'
}
}
return channel_map.get(urgency, channel_map['normal'])
Team Collaboration Workflow
Project Standup Automation:
class TeamStandupSkill(Skill):
"""Automate daily standup across platforms"""
async def execute(self, team_id, standup_time="09:00"):
team = await self.get_team_data(team_id)
# Collect updates from all platforms
updates = {}
for member in team['members']:
# Get member's preferred platform
platform = member.get('preferred_platform', 'slack')
if platform == 'slack':
update = await self.collect_slack_standup(member['slack_id'])
elif platform == 'discord':
update = await self.collect_discord_standup(member['discord_id'])
elif platform == 'telegram':
update = await self.collect_telegram_standup(member['telegram_id'])
updates[member['name']] = update
# Compile standup report
standup_report = await self.compile_standup_report(updates)
# Share report across all platforms
await self.share_standup_report(team, standup_report)
async def collect_slack_standup(self, user_id):
"""Collect standup info via Slack DM"""
slack = self.agent.get_integration('slack')
await slack.send_dm(user_id, {
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Good morning! Time for standup* 👋\nPlease share your updates:"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {"type": "plain_text", "text": "📝 Quick Update"},
"action_id": "standup_quick_update"
},
{
"type": "button",
"text": {"type": "plain_text", "text": "📋 Detailed Update"},
"action_id": "standup_detailed_update"
}
]
}
]
})
Security and Permissions
Platform-Specific Security
Slack Security Configuration:
# Slack security settings
slack_security:
signing_secret_verification: true
token_encryption: true
permissions:
admin_channels: ["#admin", "#security"]
restricted_commands: ["deploy", "database", "financial"]
audit_logging: true
rate_limiting:
requests_per_minute: 100
burst_limit: 10
Discord Security Setup:
class DiscordSecurityManager:
"""Discord-specific security controls"""
async def check_permissions(self, user, guild, command):
"""Verify user permissions for command execution"""
# Check role-based permissions
user_roles = [role.name for role in user.roles]
if command.startswith('admin_') and 'Admin' not in user_roles:
return False
# Check channel restrictions
allowed_channels = await self.get_allowed_channels(guild, command)
if channel.name not in allowed_channels:
return False
# Check rate limits
if await self.is_rate_limited(user.id):
return False
return True
async def log_security_event(self, event_type, user, guild, details):
"""Log security events for audit"""
await self.audit_logger.log({
'timestamp': datetime.utcnow(),
'event_type': event_type,
'user_id': user.id,
'guild_id': guild.id,
'details': details
})
Cross-Platform Access Control
Unified Permission System:
class UnifiedAccessControl:
"""Manage permissions across all chat platforms"""
async def check_user_access(self, user_id, platform, command):
"""Check if user has permission to execute command"""
# Get user's unified profile
user_profile = await self.get_user_profile(user_id, platform)
# Check global permissions
if not await self.check_global_permissions(user_profile, command):
return False
# Check platform-specific restrictions
platform_check = getattr(self, f'check_{platform}_permissions')
if not await platform_check(user_profile, command):
return False
# Log access attempt
await self.log_access_attempt(user_profile, platform, command, True)
return True
Monitoring and Analytics
Cross-Platform Usage Tracking
Analytics Collection:
class ChatPlatformAnalytics:
"""Track usage across all chat platforms"""
async def track_command_usage(self, platform, user_id, command, execution_time):
"""Track command usage metrics"""
await self.metrics_store.record({
'timestamp': datetime.utcnow(),
'platform': platform,
'user_id': user_id,
'command': command,
'execution_time': execution_time,
'success': True
})
async def generate_usage_report(self, timeframe="7d"):
"""Generate platform usage analytics"""
metrics = await self.metrics_store.query(timeframe)
return {
'total_commands': metrics['total_count'],
'by_platform': {
'slack': metrics['slack_count'],
'discord': metrics['discord_count'],
'telegram': metrics['telegram_count']
},
'top_commands': metrics['command_frequency'],
'average_response_time': metrics['avg_execution_time'],
'user_engagement': metrics['unique_users']
}
Health Monitoring
Integration Health Checks:
# Monitor all platform integrations
openclaw health check --platforms slack,discord,telegram
# Platform-specific diagnostics
openclaw integration test slack --verbose
openclaw integration test discord --check-permissions
openclaw integration test telegram --verify-webhook
Deployment and Scaling
Production Configuration
Multi-Platform Deployment:
# Production configuration
production:
platforms:
slack:
instances: 3
rate_limit: 100
circuit_breaker: true
discord:
instances: 2
rate_limit: 50
circuit_breaker: true
telegram:
instances: 2
rate_limit: 30
circuit_breaker: true
monitoring:
health_checks: true
metrics_collection: true
alert_thresholds:
response_time: 5000ms
error_rate: 5%
connection_failures: 10
Scaling Strategy:
# Auto-scaling based on platform load
class PlatformScaler:
"""Auto-scale platform integrations based on load"""
async def scale_based_on_load(self):
"""Monitor and scale platform instances"""
for platform in ['slack', 'discord', 'telegram']:
load_metrics = await self.get_platform_load(platform)
if load_metrics['message_queue_size'] > 1000:
await self.scale_up_platform(platform)
elif load_metrics['cpu_usage'] < 20:
await self.scale_down_platform(platform)
Best Practices and Optimization
Performance Optimization
Message Processing Optimization:
# Efficient message handling
class OptimizedMessageProcessor:
"""Optimized processing for high-volume chat platforms"""
async def process_message_batch(self, messages):
"""Process multiple messages concurrently"""
# Group messages by type and priority
message_groups = self.group_messages(messages)
# Process high-priority messages first
priority_tasks = [
self.process_message(msg) for msg in message_groups['high_priority']
]
# Process normal messages concurrently
normal_tasks = [
self.process_message(msg) for msg in message_groups['normal']
]
# Execute with different concurrency limits
await asyncio.gather(*priority_tasks)
# Process normal messages in batches
for batch in self.chunk_list(normal_tasks, 10):
await asyncio.gather(*batch)
Error Handling and Resilience
Platform Failover Strategy:
class PlatformFailoverManager:
"""Handle platform outages gracefully"""
async def send_message_with_failover(self, message, primary_platform, fallback_platforms):
"""Send message with automatic failover"""
try:
return await self.send_via_platform(message, primary_platform)
except PlatformUnavailableError:
# Try fallback platforms
for fallback in fallback_platforms:
try:
return await self.send_via_platform(message, fallback)
except Exception:
continue
# All platforms failed, queue for later retry
await self.queue_for_retry(message, primary_platform)
Integration Troubleshooting
Common Issues and Solutions
Slack Integration Issues:
# Debug Slack connection
openclaw debug slack --check-scopes --verify-tokens
# Test webhook endpoint
curl -X POST https://your-instance.com/webhooks/slack/test \
-H "Content-Type: application/json" \
-d '{"test": true}'
# Validate slash commands
openclaw slack validate-commands --sync-missing
Discord Permission Problems:
# Check Discord bot permissions
openclaw discord check-permissions --guild YOUR_GUILD_ID
# Verify gateway connection
openclaw discord test-gateway --show-events
# Sync slash commands
openclaw discord sync-commands --global
Telegram Webhook Issues:
# Set webhook URL
openclaw telegram set-webhook \
--url https://your-instance.com/webhooks/telegram \
--secret your-webhook-secret
# Check webhook status
openclaw telegram webhook-info
# Test bot functionality
openclaw telegram test-bot --send-test-message
Ready to Connect Your Team?
Chat platform integrations transform how teams interact with AI automation. Instead of leaving conversations to execute tasks, workflows happen within the natural flow of team communication.
Next Steps:
- Choose your primary platform (Slack, Discord, or Telegram)
- Follow the setup guide for your platform
- Deploy cross-platform skills for unified workflows
- Monitor usage and optimize based on team preferences
Enterprise Chat Integration: For organizations needing managed chat platform integrations, MrDelegate provides turnkey solutions with pre-configured bots, security compliance, and ongoing support.
Self-Hosted Chat Automation: Teams with specific security or customization requirements can deploy OpenClaw with full control over chat platform integrations and workflow automation.
Ready to bring AI automation into your team conversations? Explore managed options or start your OpenClaw deployment today.
Your AI executive assistant is ready.
Morning brief at 7am. Inbox triaged overnight. Calendar protected. Dedicated VPS. No Docker. Live in 60 seconds.