Overview
Connect Clawdbot to Slack and bring AI assistance to your workspace:
- Channel conversations â AI responds in public/private channels
- Direct messages â Personal AI assistant for each user
- Thread replies â Contextual responses in threads
- Slash commands â Quick AI interactions
Prerequisites
- Clawdbot installed on your machine
- A Slack workspace where you have admin permissions
- Slack account with app creation rights
Step 1: Create a Slack App
- Go to Slack API Apps
- Click âCreate New Appâ
- Choose âFrom scratchâ
- Enter an app name (e.g., âAI Assistantâ) and select your workspace
- Click Create App
Step 2: Configure Bot Permissions
Add OAuth Scopes
- Go to âOAuth & Permissionsâ in the sidebar
- Scroll to âScopesâ â âBot Token Scopesâ
- Add these scopes:
| Scope | Purpose |
|---|---|
chat:write | Send messages |
channels:history | Read channel messages |
groups:history | Read private channel messages |
im:history | Read DMs |
app_mentions:read | Respond to @mentions |
users:read | Get user info |
Step 3: Enable Event Subscriptions
- Go to âEvent Subscriptionsâ
- Toggle âEnable Eventsâ to On
- For Request URL, youâll need a public endpoint. Options:
- Use ngrok for local development:
ngrok http 18789 - Deploy to a server with public IP
- Use ngrok for local development:
- Enter:
https://your-domain.com/slack/events - Under âSubscribe to bot eventsâ, add:
app_mentionmessage.channelsmessage.groupsmessage.im
- Click Save Changes
Step 4: Install App to Workspace
- Go to âInstall Appâ in the sidebar
- Click âInstall to Workspaceâ
- Review permissions and click Allow
- Copy the Bot User OAuth Token (starts with
xoxb-)
Step 5: Get Signing Secret
- Go to âBasic Informationâ
- Under âApp Credentialsâ, find Signing Secret
- Click Show and copy it
Step 6: Add Slack to Clawdbot
Run in your terminal:
clawdbot channels add slack
Enter when prompted:
- Bot Token: Your
xoxb-token - Signing Secret: The signing secret from Basic Information
Or configure manually:
clawdbot config set slack.botToken "xoxb-your-token"
clawdbot config set slack.signingSecret "your-signing-secret"
Step 7: Start the Gateway
clawdbot gateway
If using ngrok for development:
# In another terminal
ngrok http 18789
Update the Request URL in Slack with your ngrok URL.
Configuration Options
Restrict to Specific Channels
clawdbot config set slack.allowedChannels "C01234567,C09876543"
Set Response Mode
# Respond only when mentioned (default)
clawdbot config set slack.trigger mention
# Respond to all messages
clawdbot config set slack.trigger all
Thread Behavior
# Always reply in threads (recommended for busy channels)
clawdbot config set slack.replyInThread true
Slash Commands (Optional)
Add custom slash commands:
- Go to âSlash Commandsâ in your app settings
- Click âCreate New Commandâ
- Configure:
- Command:
/ask - Request URL:
https://your-domain.com/slack/commands - Description: âAsk the AI assistantâ
- Command:
- Save and reinstall the app
Production Deployment
For production use, deploy Clawdbot on a server:
Using Docker
docker run -d \
-e SLACK_BOT_TOKEN=xoxb-your-token \
-e SLACK_SIGNING_SECRET=your-secret \
-p 18789:18789 \
clawdbot/clawdbot gateway
Verify Webhook
Slack will send a challenge request to verify your endpoint. Clawdbot handles this automatically.
Troubleshooting
âURL Verification Failedâ
- Ensure Clawdbot gateway is running
- Check the URL is publicly accessible
- Verify no firewall blocking port 18789
Bot Not Responding
- Check the bot is invited to the channel
- Verify OAuth scopes include
channels:history - Confirm events are subscribed correctly
âInvalid Signing Secretâ
Re-copy the signing secret from Slack. Make sure there are no extra spaces.
Messages Delayed
If using ngrok free tier, connections may timeout. Consider:
- Upgrading ngrok
- Deploying to a cloud server
- Using Slackâs Socket Mode (no public URL needed)
Socket Mode (Alternative)
For local development without a public URL:
- Go to âSocket Modeâ in app settings
- Enable Socket Mode
- Generate an App-Level Token with
connections:writescope - Configure Clawdbot:
clawdbot config set slack.socketMode true
clawdbot config set slack.appToken "xapp-your-app-token"
Next Steps
- Connect Discord â For community servers
- Connect Signal â Secure messaging
- Voice Assistant â Voice interaction