Overview
The Slack integration uses @slack/bolt with Socket Mode, which means no public URL is required. The bot connects directly to Slack from your machine.Features
- Socket Mode - No webhooks or public URLs needed
- Public and private channels - Respond in any channel the bot is added to
- Direct messages - Users can DM the bot directly
- Multi-channel support - Monitor multiple channels simultaneously
- Channel metadata sync - Automatically syncs channel names
- Thread flattening - Reads threaded replies (responds in main channel)
Adding Slack
Use the/add-slack skill to add Slack support:
Choose deployment mode
- Replace WhatsApp - Slack becomes the only channel
- Alongside - Both WhatsApp and Slack run simultaneously
Apply code changes
The skill runs the skills engine which:
- Adds
src/channels/slack.ts(SlackChannel implementation) - Adds
src/channels/slack.test.ts(46 unit tests) - Merges multi-channel support into
src/index.ts - Adds Slack config to
src/config.ts - Installs the
@slack/boltNPM package
Creating a Slack app
The setup process requires two tokens: a Bot Token (xoxb-) and an App-Level Token (xapp-).
Quick setup
Create the app
- Go to api.slack.com/apps
- Click Create New App → From scratch
- Enter app name and select workspace
Enable Socket Mode
- Go to Socket Mode in sidebar
- Toggle Enable Socket Mode to On
- Generate token with name
nanoclaw - Copy the App-Level Token (starts with
xapp-)
Subscribe to events
- Go to Event Subscriptions
- Toggle Enable Events to On
- Add bot events:
message.channels(public channels)message.groups(private channels)message.im(direct messages)
- Click Save Changes
Add OAuth scopes
- Go to OAuth & Permissions
- Add these Bot Token Scopes:
chat:write(send messages)channels:history(read public channels)groups:history(read private channels)im:history(read DMs)channels:read(list channels)groups:read(list private channels)users:read(look up display names)
Configuration
Environment variables
Add to.env:
Token reference
| Token | Prefix | Where to find it |
|---|---|---|
| Bot User OAuth Token | xoxb- | OAuth & Permissions → Bot User OAuth Token |
| App-Level Token | xapp- | Basic Information → App-Level Tokens |
Sync to container
Build and restart
Adding bot to channels
The bot only receives messages from channels it has been explicitly added to.
Repeat for each channel you want the bot to monitor.
Registering channels
Get channel ID
Option A - From URL: Open the channel in Slack on the web. The URL looks like:C0123456789 part is the channel ID.
Option B - Right-click:
Right-click the channel name → Copy link → extract the C... ID from the URL
Option C - Via API:
Register the channel
The JID format isslack: followed by the channel ID.
For your main channel (responds to all messages):
Testing the connection
Send a message in your registered Slack channel:- For main channel: Any message works
- For non-main channels: Include your trigger pattern (e.g.,
@Andy hello)
Check logs
JID format
Slack channels use theslack: prefix:
- Public channel:
slack:C0123456789 - Private channel:
slack:G0123456789 - Direct message:
slack:D0123456789
Channel types
The Slack integration supports:- Public channels - Bot must be added to the channel
- Private channels - Bot must be invited to the channel
- Direct messages - Users can DM the bot directly
- Multi-channel - Can monitor multiple channels simultaneously
Implementation details
The Slack channel implements theChannel interface using Socket Mode:
Troubleshooting
Bot not responding
Bot not responding
Check these items:
- Both tokens are set in
.envAND synced todata/env/env - Channel is registered:
- For non-main channels: message must include trigger pattern
- Service is running:
Bot not receiving messages
Bot not receiving messages
Verify these settings:
- Socket Mode is enabled (Slack app settings)
- Bot is subscribed to correct events:
message.channelsmessage.groupsmessage.im
- Bot has been added to the channel
- Bot has required OAuth scopes
Missing scope errors
Missing scope errors
If logs show
missing_scope errors:- Go to OAuth & Permissions in Slack app settings
- Add the missing scope listed in the error
- Reinstall the app to workspace (scope changes require reinstall)
- Copy the new Bot Token (it changes on reinstall)
- Update
.envand sync:cp .env data/env/env - Restart:
launchctl kickstart -k gui/$(id -u)/com.nanoclaw
Wrong token used
Wrong token used
Verify token format:
- Bot tokens start with
xoxb- - App tokens start with
xapp-
Known limitations
- Threads are flattened - Threaded replies appear as regular channel messages. Responses go to main channel, not back into threads.
- No typing indicator - Slack’s Bot API doesn’t expose a typing indicator endpoint.
- Naive message splitting - Long messages split at 4000 chars, may break mid-sentence.
- No file handling - Only text content is processed. File uploads and rich blocks are ignored.
- Unbounded metadata sync - Channel list pagination has no upper bound, may be slow in large workspaces.
Removing Slack
To remove the Slack integration:Revert code changes
- Remove
SlackChannelimport and creation fromsrc/index.ts - Remove Slack config from
src/config.ts - Remove Slack JID tests from
src/routing.test.ts
Next steps
Add Gmail
Add Gmail integration to your installation
Add Discord
Add Discord support to your installation
Skills system
Learn more about how skills work