Slack Setup
Slack works well with Moltbot if your team (or just you) lives in Slack. The setup is more involved than Telegram — Slack's app platform has a lot of moving parts — but once it's running, it's smooth.
One thing to know upfront: Slack's free plan has message history limits. If you're on the free tier, older messages disappear after 90 days. This doesn't affect Moltbot's operation directly, but it's worth knowing.
Create a Slack App
- Go to api.slack.com/apps
- Click "Create New App"
- Choose "From scratch" (not from a manifest, though we'll cover that later)
- Name your app and pick your workspace
- You're in the app dashboard
Set Up Bot Token Scopes
Go to OAuth & Permissions in the sidebar. Scroll down to Bot Token Scopes and add:
app_mentions:read— so the bot can see when it's mentionedchannels:history— read messages in public channelschannels:read— see which channels existchat:write— send messagesgroups:history— read messages in private channels (if you want that)groups:read— see private channelsim:history— read DMsim:read— see DM conversationsim:write— open DMsusers:read— know who's talking
That's a lot of scopes. Bit of a pain but worth it — if you skip any, certain features won't work and the error messages aren't always helpful.
Install to Workspace
Still on the OAuth page, click "Install to Workspace" at the top. Authorize the app.
You'll get a Bot User OAuth Token that starts with xoxb-. Copy it.
Set Up Event Subscriptions
Go to Event Subscriptions in the sidebar and toggle it on.
For the Request URL, you need a public HTTPS endpoint. Moltbot's default webhook path for Slack is:
https://your-domain.com/slack/eventsMoltbot needs to be running and accessible from the internet for verification to succeed. Use Cloudflare Tunnel, ngrok, or a proper server setup.
Under Subscribe to bot events, add:
app_mention— someone @mentions the botmessage.channels— messages in public channelsmessage.groups— messages in private channelsmessage.im— direct messages
Click "Save Changes."
Enable Socket Mode (Alternative)
If you don't want to deal with webhooks, Slack offers Socket Mode. It's like Telegram's long polling — no public URL needed.
Go to Socket Mode in the sidebar and enable it. You'll get an App-Level Token that starts with xapp-. You'll need this in addition to the bot token.
channels:
slack:
mode: socket
appToken: "xapp-your-app-level-token"Socket Mode is easier for personal setups. Webhooks are better for production.
Configure Moltbot
Environment Variables
export SLACK_BOT_TOKEN=xoxb-your-bot-token
export SLACK_SIGNING_SECRET=your-signing-secret
# Only if using Socket Mode:
export SLACK_APP_TOKEN=xapp-your-app-level-tokenThe signing secret is found under Basic Information → App Credentials in your Slack app dashboard.
Config File
# ~/.moltbot/config.yaml
channels:
slack:
botToken: "xoxb-your-bot-token"
signingSecret: "your-signing-secret"
# mode: socket # uncomment for Socket Mode
# appToken: "xapp-..." # required for Socket ModeOr the wizard:
moltbot configure --section slackStart and Pair
moltbot startDM the bot in Slack or mention it in a channel. Pairing code appears in your terminal:
moltbot pairing approve slack ABCD-1234You're good to go.
How It Works
DMs
The bot always responds to direct messages from paired users.
Channels
In channels, the bot only responds when @mentioned. This is the sane default. Nobody wants a bot that responds to every single message in #general.
@moltbot what's our deploy schedule this week?Threads
Moltbot is thread-aware. If someone starts a thread with a mention, the bot will continue responding in that thread. This keeps channels clean and is honestly one of the nicer Slack-specific features.
Channel Restrictions
channels:
slack:
allowedChannels:
- "bot-playground"
- "ask-ai"App Manifest (Quick Setup)
If the manual setup above feels like a lot, you can use a Slack App Manifest to configure everything at once. When creating a new app, choose "From an app manifest" and paste:
display_information:
name: Moltbot
description: AI assistant powered by Moltbot
oauth_config:
scopes:
bot:
- app_mentions:read
- channels:history
- channels:read
- chat:write
- groups:history
- groups:read
- im:history
- im:read
- im:write
- users:read
settings:
event_subscriptions:
bot_events:
- app_mention
- message.channels
- message.groups
- message.im
socket_mode_enabled: trueThis sets up Socket Mode with all the right scopes in one shot. Still need to grab the tokens afterward though.
Troubleshooting
Bot doesn't respond to mentions
- Check that
app_mentions:readscope is added - Make sure the
app_mentionevent is subscribed - Verify the bot is actually in the channel (invite it with
/invite @moltbot)
"not_authed" or "invalid_auth" errors
Your bot token is wrong or expired. Reinstall the app to your workspace to get a fresh token.
Events not arriving
- If using webhooks: check your Request URL verification status in the Slack dashboard
- If using Socket Mode: make sure you set the
appTokenand that Socket Mode is enabled in the dashboard - Look at
moltbot logs— Slack errors are usually descriptive
Bot responds to everything (not just mentions)
Check your event subscriptions. If you subscribed to message.channels without filtering, the bot sees all messages. Moltbot should filter these by default, but check your groupPolicy setting:
channels:
slack:
groupPolicy: "mention-only"Rate limiting
Slack rate limits are generous for small-scale use. If you hit them, you're probably doing something unusual. Moltbot queues messages automatically when throttled.
What's Next
- Security — review your policies before sharing the bot with your team
- Memory — the bot remembers things across all channels
- Proactive Messages — schedule messages to Slack channels