New to channel setup? For a hands-on, step-by-step tutorial, check out our Channel Setup Tutorial. This page is a comprehensive reference covering all Slack features and configuration options.

Slack is a popular team collaboration platform. OpenClaw (formerly Moltbot, Clawdbot) connects to Slack workspaces using the Bolt framework, providing DMs, channels, and workspace automation capabilities.

Quick Setup

Setting up Slack requires creating a Slack app:

  1. Create a Slack app at Slack API
  2. Get your bot token and app token
  3. Configure in OpenClaw
  4. Install app to your workspace
  5. Start chatting!

Creating a Slack App

Step 1: Create App

  1. Go to Slack API
  2. Click "Create New App"
  3. Choose "From scratch"
  4. Enter app name and select your workspace
  5. Click "Create App"

Step 2: Configure App Features

Enable Socket Mode (required for OpenClaw):

  1. Go to "Socket Mode" in the app settings
  2. Enable Socket Mode
  3. Create an app-level token with connections:write scope
  4. Copy the app token (starts with xapp-)

Step 3: Get Bot Token

  1. Go to "OAuth & Permissions"
  2. Add bot scopes: chat:write, im:read, im:write, channels:read
  3. Install app to workspace
  4. Copy the bot token (starts with xoxb-)

Configuration

Configure Slack in your OpenClaw configuration file:

Slack Configuration
{
  "channels": {
    "slack": {
      "botToken": "xoxb-your-bot-token",
      "appToken": "xapp-your-app-token"
    }
  }
}

Environment Variables

Alternatively, use environment variables (environment variables take precedence):

Environment Variables
export SLACK_BOT_TOKEN="xoxb-your-bot-token"
export SLACK_APP_TOKEN="xapp-your-app-token"

DM Access Control

Control who can send direct messages to your OpenClaw assistant:

DM Allowlist
{
  "channels": {
    "slack": {
      "botToken": "xoxb-your-bot-token",
      "appToken": "xapp-your-app-token",
      "dm": {
        "allowFrom": ["U1234567890", "U0987654321"]
      }
    }
  }
}

Add Slack user IDs to the allowFrom array to control DM access. You can find user IDs in Slack by right-clicking a user and selecting "View profile".

Channel Support

OpenClaw can interact in Slack channels:

  • Public Channels - Join public channels in your workspace
  • Private Channels - Invite the bot to private channels
  • Mentions - Bot responds when mentioned in channels
  • Threads - Supports threaded conversations

Security Best Practices

  • Secure Tokens - Never share your bot or app tokens
  • Use Environment Variables - Store tokens in environment variables, not in config files
  • DM Allowlist - Always configure dm.allowFrom to control access
  • Minimal Scopes - Only request the Slack scopes you actually need
  • Regular Rotation - Rotate tokens periodically for security

Troubleshooting

Bot Not Responding

If the bot doesn't respond:

  1. Verify bot token and app token are correct
  2. Check Gateway is running
  3. Verify Socket Mode is enabled in Slack app settings
  4. Check bot is installed to your workspace
  5. Review Gateway logs for errors

Can't Receive DMs

If DMs aren't working:

  1. Check dm.allowFrom configuration
  2. Verify user ID is correct (Slack user IDs start with U)
  3. Ensure bot has im:read and im:write scopes
  4. Check bot is installed to workspace

Socket Mode Connection Issues

If Socket Mode fails:

  1. Verify app token has connections:write scope
  2. Check app token starts with xapp-
  3. Ensure Socket Mode is enabled in Slack app settings
  4. Check network connectivity

Learn More