Discord Integration
Bring OpenClaw AI Power to Your Discord Server
Transform your Discord community with an intelligent AI assistant. OpenClaw integrates seamlessly with Discord's bot ecosystem, providing slash commands, voice channel support, rich embeds, role-based permissions, and powerful moderation tools. Whether you're running a gaming community, study group, or business server, AI assistance is just a command away.
Setup Guide
Create Discord Application
Visit the Discord Developer Portal and create a new application. This will house your bot and provide the necessary credentials. Give it a name that represents your AI assistant and add a profile picture.
# 1. Go to https://discord.com/developers/applications
# 2. Click 'New Application'
# 3. Name your application (e.g., 'OpenClaw AI')
# 4. Go to 'Bot' section in left sidebar
# 5. Click 'Add Bot'
# 6. Copy the Bot Token (keep this secret!)
# Important Bot Settings:
# - PUBLIC BOT: Enable if anyone can invite
# - PRESENCE INTENT: Enable for status updates
# - SERVER MEMBERS INTENT: Enable for member events
# - MESSAGE CONTENT INTENT: Enable to read messages Install Discord Bridge Module
Add the Discord bridge to your OpenClaw installation. The bridge uses discord.js under the hood and handles all communication with Discord's Gateway and REST APIs.
# Using OpenClaw CLI
openclaw install discord-bridge
# Or manual installation
cd /path/to/openclaw
npm install @openclaw/discord-bridge
# This installs discord.js and related packages
npm install discord.js @discordjs/voice @discordjs/rest Configure Bot Connection
Create your Discord configuration file with the bot token, client ID, and connection settings. Configure intents based on what features you need - message content requires explicit intent enabling.
# config/discord.yaml
discord:
enabled: true
token: "YOUR_BOT_TOKEN_HERE"
client_id: "YOUR_CLIENT_ID_HERE"
# Gateway intents
intents:
- Guilds
- GuildMessages
- GuildMembers
- MessageContent
- GuildVoiceStates
- DirectMessages
# Presence settings
presence:
status: online # online, idle, dnd, invisible
activity:
type: watching # playing, streaming, listening, watching, competing
name: "for /help commands"
# Sharding (for large bots)
sharding:
enabled: false
total_shards: auto Define Slash Commands
Create slash commands that will be registered with Discord. Define command names, descriptions, options, and subcommands. These appear in Discord's command menu when users type '/'.
# config/discord-commands.yaml
slash_commands:
- name: ask
description: Ask OpenClaw AI anything
options:
- name: question
description: Your question for the AI
type: STRING
required: true
- name: image
description: Generate or analyze images
options:
- name: action
description: What to do
type: STRING
required: true
choices:
- name: Generate
value: generate
- name: Analyze
value: analyze
- name: prompt
description: Image prompt or description
type: STRING
required: true
- name: settings
description: Configure your OpenClaw preferences
default_member_permissions: "0" # Admin only
options:
- name: channel
description: Set AI response channel
type: CHANNEL
- name: role
description: Set required role for AI commands
type: ROLE Configure Message Handlers
Set up how OpenClaw responds to different message types beyond slash commands. Configure mention responses, DM handling, and context-aware conversations.
# config/discord-handlers.yaml
handlers:
# Respond when mentioned
mentions:
enabled: true
require_prefix: false
respond_in_thread: true # Create thread for conversations
# Direct message handling
dm:
enabled: true
welcome_message: "Hi! I'm your OpenClaw AI assistant. How can I help?"
# Auto-moderation
moderation:
enabled: true
actions:
spam_detection: warn
toxic_content: delete
link_filtering: false
# Message context
context:
history_limit: 20 # Messages to consider
thread_aware: true
channel_topics: true # Use channel topic for context Set Up Voice Features
Configure voice channel integration for audio interactions. OpenClaw can join voice channels, speak responses, transcribe audio, and even play music or sound effects.
# config/discord-voice.yaml
voice:
enabled: true
# Voice join settings
join:
command: /voice join
auto_leave_empty: true
auto_leave_timeout: 300 # seconds
# Text-to-speech
tts:
enabled: true
voice: en-US-Standard-D
speed: 1.0
# Speech-to-text
stt:
enabled: true
language: en-US
trigger_word: "hey openclaw" # Optional wake word
# Audio playback
audio:
enabled: true
volume: 0.5
allowed_sources:
- youtube
- soundcloud
- direct_url Configure Embeds and Components
Customize how OpenClaw formats responses using Discord embeds, buttons, and select menus. Create templates for different response types.
# config/discord-embeds.yaml
embeds:
default:
color: 0x5865F2 # Discord blurple
footer:
text: "Powered by OpenClaw AI"
icon_url: "/images/openclaw-icon.png"
success:
color: 0x57F287 # Green
error:
color: 0xED4245 # Red
warning:
color: 0xFEE75C # Yellow
components:
feedback_buttons:
- label: "Helpful"
style: SUCCESS
emoji: "<3"
custom_id: "feedback:helpful"
- label: "Not Helpful"
style: DANGER
emoji: "<2"
custom_id: "feedback:not_helpful" Generate Invite Link and Deploy
Create an OAuth2 invite link with the correct permissions and add the bot to your server. Register slash commands and verify everything is working.
# Generate invite URL with OpenClaw CLI
openclaw discord invite-url
# Or manually construct:
# https://discord.com/api/oauth2/authorize?
# client_id=YOUR_CLIENT_ID&
# permissions=8&
# scope=bot%20applications.commands
# Register slash commands
openclaw discord commands register --global
# Or for specific server:
openclaw discord commands register --guild YOUR_GUILD_ID
# Start the bot
openclaw discord start
# Check status
openclaw discord status
# View logs
openclaw logs discord --follow What You Can Do
Community Q&A Assistant
Provide instant answers to community questions 24/7. Whether it's server rules, game strategies, course material, or general knowledge, OpenClaw responds with accurate, helpful information. Reduce moderator workload while improving member experience.
Gaming Companion
Enhance gaming sessions with AI assistance. Get build recommendations, strategy tips, lore explanations, and team coordination help. The bot can join voice chat, call out information, and keep track of game-related data for your group.
Study Group Helper
Transform your study server with AI tutoring. Explain concepts, quiz members, summarize readings, solve problems, and facilitate group study sessions. Create practice tests, flashcards, and study guides on demand.
Automated Moderation
Keep your server safe with AI-powered moderation. Detect and handle spam, toxic content, raids, and rule violations automatically. Warn users, delete messages, and escalate serious issues to human moderators.
Event Coordination
Plan and manage server events with AI assistance. Create event announcements, handle RSVPs, send reminders, coordinate schedules across time zones, and generate post-event summaries.
Creative Writing Partner
Collaborate on creative projects with AI. Brainstorm story ideas, develop characters, continue narratives, provide feedback on writing, and run collaborative storytelling games like AI Dungeon directly in your server.
Customer Support Channel
Provide professional customer support through Discord. Answer product questions, troubleshoot issues, process simple requests, and escalate complex tickets. Integrate with your helpdesk for seamless support workflows.
Music and Entertainment
Enhance voice channels with music playback, trivia games, conversation starters, and interactive entertainment. OpenClaw can DJ your sessions, run quiz nights, and keep the conversation flowing.
Onboarding Automation
Welcome new members with personalized greetings, guide them through server rules, assign roles based on responses, and answer their initial questions. Create an engaging first impression that scales with your community.
Known Limitations
- Message content intent requires verification for bots in 100+ servers - plan ahead for growth
- Slash commands can take up to an hour to propagate globally after registration
- Voice features require additional dependencies and server resources for audio processing
- Rate limits apply: 50 requests per second globally, with per-route limits varying
- Embeds are limited to 6000 total characters across all fields
- Bots cannot DM users who have DMs disabled or share no servers with the bot
- File uploads are limited to 25MB (or 100MB with Nitro boosted servers)
- Bots cannot see messages sent before they joined the server
- Thread auto-archive can interrupt long conversations if not managed properly
- Voice channel join/leave events may be delayed during high Discord load
- Our team can help you work around these limitations with custom configurations
Related Content
Supercharge Your Gmail with OpenClaw AI
Connect OpenClaw to Gmail for intelligent email management. Automatically summarize messages, draft responses, organize your inbox, and manage emails through natural language commands.
Connect OpenClaw to LINE Messenger
Deploy OpenClaw on LINE messenger to reach 200 million users across Japan, Taiwan, Thailand, and Indonesia. Build powerful AI chatbots with rich messaging, LIFF apps, and LINE ecosystem integration.
OpenClaw on Matrix: Decentralized AI for a Decentralized World
Deploy OpenClaw on the Matrix protocol for a truly decentralized AI assistant. Self-host everything, federate with others, and maintain complete sovereignty over your AI interactions.
Deploy OpenClaw on Facebook Messenger
Deploy OpenClaw as a Facebook Messenger bot for personal or business use. Automate customer service, handle inquiries, and provide 24/7 AI assistance through the platform with 1.3 billion users.