The Slack channel connects NullClaw to Slack using Socket Mode for real-time events and the Web API for sending messages.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nullclaw/nullclaw/llms.txt
Use this file to discover all available pages before exploring further.
Features
- Socket Mode for real-time message delivery
- HTTP Events API fallback
- Direct messages and channel support
- Thread support
- Permission policies (DM and group)
- Allowlist-based access control
- Automatic reconnection
- Bot user context awareness
Configuration
Add Slack to yourconfig.json:
Configuration Options
Slack bot token starting with
xoxb-. Get this from your Slack App’s “OAuth & Permissions” page.Slack app-level token starting with
xapp-. Required for Socket Mode. Get this from “Basic Information > App-Level Tokens”.List of allowed Slack user IDs (e.g.,
U123456789). Use "*" to allow everyone.Finding user IDs: Click a user’s profile → More → Copy member IDRestrict bot to a specific channel ID (e.g.,
C123456789). If null, works in all channels.Message delivery mode:
socket— Real-time Socket Mode (recommended)http— HTTP Events API with webhook
Direct message permission policy:
allow— Allow all DMsdeny— Deny all DMsallowlist— Only allow DMs from users inallow_from
Channel/group message policy:
open— Respond to all messagesmention_only— Only respond when mentioned with@botnameallowlist— Only respond to users inallow_from
Slack signing secret for verifying HTTP requests (required for HTTP mode). Found under “Basic Information > App Credentials”.
Webhook endpoint path for HTTP mode
Account identifier for multi-account setups
Setup Guide
Create a Slack App
- Go to Slack API Apps
- Click “Create New App”
- Choose “From scratch”
- Enter app name and select workspace
- Click “Create App”
Configure Bot Scopes
- Navigate to “OAuth & Permissions”
- Scroll to “Scopes” > “Bot Token Scopes”
- Add the following scopes:
chat:write— Send messageschannels:history— Read channel messagesgroups:history— Read private channel messagesim:history— Read DM messagesapp_mentions:read— Detect mentions
- Click “Install to Workspace”
- Authorize the app
- Copy the “Bot User OAuth Token” (starts with
xoxb-)
Enable Socket Mode
- Navigate to “Socket Mode” in the left sidebar
- Toggle “Enable Socket Mode” to On
- Under “Basic Information” > “App-Level Tokens”:
- Click “Generate Token and Scopes”
- Name: “NullClaw Socket Token”
- Scope:
connections:write
- Copy the app token (starts with
xapp-)
Subscribe to Events
- Navigate to “Event Subscriptions”
- Toggle “Enable Events” to On
- Under “Subscribe to bot events”, add:
message.channels— Channel messagesmessage.groups— Private channel messagesmessage.im— Direct messagesapp_mention— Bot mentions
- Click “Save Changes”
Get Your User ID
- In Slack, click your profile picture
- Select “Profile”
- Click “More” (three dots)
- Select “Copy member ID”
Socket Mode vs HTTP Events
Socket Mode (Recommended)
Advantages:- No public endpoint required
- Works behind firewalls/NAT
- Easier setup (no webhook configuration)
- Real-time delivery
HTTP Events Mode
Advantages:- No persistent WebSocket connection
- Better for serverless deployments
- Request verification via signing secret
- Configure gateway in NullClaw config
- Expose webhook endpoint (via ngrok, Cloudflare Tunnel, etc.)
- Set Request URL in Slack “Event Subscriptions” to
https://your-domain.com/slack/events
Permission Policies
Allowlist-Only (Secure Default)
Mention-Only in Channels
Open Access
Thread Support
NullClaw automatically detects and maintains thread context:- Messages in threads are replied to in the same thread
- Thread metadata is preserved across message exchanges
- Use
channel_id:thread_tsformat for explicit thread targeting
Multiple Workspaces
Run bots in multiple Slack workspaces:Troubleshooting
Socket Connection Failed
- Verify app token starts with
xapp-and is valid - Check that
connections:writescope is granted to the app token - Ensure Socket Mode is enabled in Slack App settings
- Review logs:
nullclaw --log-level debug
Bot Not Responding
- Verify user ID is in
allow_from - Check dm_policy and group_policy settings
- Ensure bot has correct event subscriptions
- Verify bot token has required OAuth scopes
- If in a channel, check group_policy (may need to mention bot)
HTTP Events Not Working
- Verify signing secret is correct
- Check that webhook URL is publicly accessible
- Ensure Request URL in Slack matches your webhook endpoint
- Verify SSL certificate is valid
- Check gateway configuration in NullClaw
Missing Message History
- Add missing history scopes:
channels:historygroups:historyim:history
- Reinstall app to workspace after adding scopes
- Restart NullClaw
Source Code
Implementation:src/channels/slack.zig