Slack bot integration for opencode that creates threaded conversations.
- Create a Slack app at https://api.slack.com/apps
- Enable Socket Mode
- Enable Event Subscriptions and add these Bot Events:
message.channelsmessage.groupsmessage.im(optional, for direct messages)
- Add the following OAuth scopes:
chat:writeapp_mentions:readchannels:historygroups:history
- Install the app to your workspace
- Reinstall the app if you change scopes or subscribed events
- Set environment variables in
.env:SLACK_BOT_TOKEN- Bot User OAuth TokenSLACK_SIGNING_SECRET- Signing Secret from Basic InformationSLACK_APP_TOKEN- App-Level Token from Basic Information
# Edit .env with your Slack app credentials
bun devInvite the bot to a channel before testing it, for example with /invite @opencode.
The bot will respond to messages in channels where it's added, creating separate opencode sessions for each thread.