OpenClaw Discord & Slack Setup
OpenClaw Discord setup and Slack setup both connect an AI agent to team chat, but the credentials and event transports differ. Discord uses a bot token and Gateway connection; Slack commonly uses Socket Mode with a bot token plus an app-level token, or HTTP mode with a bot token plus a signing secret. Configure only the rooms and users that need access, then probe the channel before granting broader tools.
> AI content disclosure: AI assisted with organizing this guide; the channel and permission details were checked against the cited documentation.
Discord Bot Token Setup and Permissions
Create an application in the Discord Developer Portal, add a bot, and copy the bot token into a secret store or the DISCORD_BOT_TOKEN environment variable. Invite the bot to the intended server with the least permissions required for its use case. Message reading, sending, reactions, files, threads, and moderation actions have separate permission implications; do not grant administrative access for a simple assistant channel.
When audience or role checks depend on member data, enable the relevant Discord privileged intent. If a probe reports Missing Access, verify that the bot belongs to the same guild, can view the target channel, and has the expected intent and role permissions.
Add Discord Channel to openclaw.json
Use stable guild, channel, user, and role IDs where possible:
{
channels: {
discord: {
enabled: true,
token: "YOUR_DISCORD_BOT_TOKEN",
dmPolicy: "pairing",
groupPolicy: "allowlist",
guilds: {
"123456789012345678": {
requireMention: true,
users: ["987654321098765432"],
channels: {
"help": { allow: true, requireMention: true }
}
}
}
}
}
}
The values are placeholders. Name matching is less stable than ID matching and can require a dangerous compatibility flag, so resolve names to IDs during setup instead of relying on mutable display names.
Configure the Allowlist to Prevent Unauthorized Access
Discord has separate controls for DMs and guild messages. dmPolicy: "pairing" makes unknown DM senders request approval. groupPolicy: "allowlist" requires the guild to appear in guilds; optional users and roles then narrow who can trigger the bot. If a guild has a channels block, unlisted channels are denied.
Slack uses the same access-control goals but different keys. Keep DMs behind pairing or an explicit allowFrom list, set groupPolicy: "allowlist", and list channel IDs under channels.slack.channels. In both services, visible slash commands do not equal authorization; OpenClaw rechecks access when a command runs.
OpenClaw Discord on Windows: Special Relay Config
Current OpenClaw documentation does not require a special Discord relay merely because the Gateway runs on Windows. Native Windows users can use the Windows Hub or PowerShell installer, while WSL2 remains a supported Gateway option. Discord still connects outbound with its normal bot transport.
A relay is a separate Slack deployment mode, not a Windows-specific Discord requirement. Use it only when your architecture explicitly calls for the documented relay service. For a standard Windows Discord bot, focus on service startup, environment-variable visibility, firewall egress, and whether the same Windows or WSL account owns the OpenClaw state.
Slack App Setup: Bot Token and Channel Config
For the default Socket Mode path, create a Slack app, enable Socket Mode, issue an app-level token with connections:write, install the app to the workspace, and store both tokens:
{
channels: {
slack: {
enabled: true,
mode: "socket",
appToken: "YOUR_SLACK_APP_TOKEN",
botToken: "YOUR_SLACK_BOT_TOKEN",
dmPolicy: "pairing",
groupPolicy: "allowlist",
channels: {
"C0123456789": { requireMention: true }
}
}
}
}
For HTTP Request URLs, replace the app token with a signing secret and expose a verified HTTPS event endpoint. Enterprise Grid org-wide installs have additional constraints, so use the dedicated official manifest and enterpriseOrgInstall setting instead of adapting a workspace example.
Fix Common Discord/Slack Connection Errors
Start with a shared diagnostic sequence:
openclaw status
openclaw channels status --probe
openclaw channels logs --channel all
openclaw doctor
For Discord, check the token, required intents, guild membership, channel visibility, and mention gating. A log such as drop guild message (mention required) means the transport works but policy ignored the message.
For Slack Socket Mode, confirm both the bot token and app token are available to the Gateway service. In HTTP mode, confirm the signing secret and Request URL. A configured SecretRef can still show configured_unavailable when the current process cannot resolve it, so inspect credential source status instead of immediately recreating the app.
Security Warning: Never Leave Relay Open Without Allowlist
Any chat transport can deliver untrusted instructions to an agent with real tools. Require channel authentication, keep user and room allowlists narrow, separate direct-message sessions when multiple people have access, and restrict file, shell, browser, and moderation actions. If you intentionally use Slack relay mode, protect the relay URL and auth token as part of the Gateway trust boundary.
For message-channel access patterns beyond Discord and Slack, see the OpenClaw WhatsApp guide. For host-level controls, use the security checklist.
In Verdent
Discord and Slack are communication surfaces; they do not provide repository isolation, implementation planning, or code verification by themselves. Verdent is a separate AI development product for software work and can complement a messaging setup when the task moves from conversation to code changes.
Sources: OpenClaw Discord documentation, Slack documentation, channel troubleshooting, and OpenClaw channels reference.
Frequently Asked Questions
Do Discord and Slack use the same OpenClaw token?
No. Discord uses a Discord bot token. Slack Socket Mode uses a Slack bot token and app token; Slack HTTP mode uses a bot token and signing secret.
Why can users see a slash command but not run it?
The chat platform may display the command broadly, while OpenClaw applies its own allowlist when execution is requested.
Is a public server required for Slack Socket Mode?
No. Socket Mode opens an outbound connection. HTTP Request URL mode needs a reachable HTTPS endpoint.
Should I allow bots to message each other?
Only with explicit loop protection and a tightly scoped design. Uncontrolled bot-to-bot replies can create message loops and unexpected model usage.
Move from chat setup to code work
Use Discord or Slack for coordination, then switch to Verdent when you need isolated repositories, implementation planning, and code verification. If your relay is failing, review the OpenClaw Gateway troubleshooting guide.