Requirements
- A Slack app with Socket Mode enabled.
- A bot token (
xoxb-β¦) and an app-level token (xapp-β¦). - The
slack_sdklibrary (installed with Flowly's Slack extra).
Configuration
Set under channels.slack in ~/.flowly/config.json:
{
"channels": {
"slack": {
"enabled": true,
"mode": "socket",
"botToken": "xoxb-...",
"appToken": "xapp-...",
"groupPolicy": "mention",
"groupAllowFrom": [],
"dm": {
"enabled": true,
"policy": "open",
"allowFrom": []
}
}
}
}| Key | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Start the Slack adapter at gateway boot. |
mode | string | "socket" | Connection mode; socket (Socket Mode) is supported. |
botToken | string | "" | Bot token (xoxb-β¦). |
appToken | string | "" | App-level token (xapp-β¦) for Socket Mode. |
groupPolicy | "mention" | "open" | "allowlist" | "mention" | Access policy for channel/group messages. |
groupAllowFrom | string[] | [] | Allowed channel IDs (used when groupPolicy is allowlist). |
dm.enabled | bool | true | Allow direct messages to the bot. |
dm.policy | "open" | "allowlist" | "open" | DM access policy. |
dm.allowFrom | string[] | [] | Allowed Slack user IDs (used when dm.policy is allowlist). |
Access policies
- DMs are gated by
dm.enabled, thendm.policy(openorallowlistagainstdm.allowFrom). - Channel/group messages are gated by
groupPolicy:mentionβ only messages that@mentionthe bot (orapp_mentionevents) trigger it.openβ any message in the channel triggers it.allowlistβ only channels listed ingroupAllowFrom.
not use the pairing store; manage access via the keys above.
Connect method
The adapter connects over Socket Mode, acks incoming Events API requests immediately, then processes message and app_mention events (ignoring subtypes and the bot's own messages, and de-duplicating channel mentions). It adds an :eyes: reaction to the triggering message. Outbound replies use chat_postMessage; non-DM replies are posted in a thread.
Setup steps
- Create a Slack app and enable Socket Mode.
- Add a bot user and the required event subscriptions (
message,app_mention); install the app to your workspace. - Copy the bot token (
xoxb-β¦) and generate an app-level token (xapp-β¦). - Set
channels.slack.enabledtotrue, pastebotTokenandappToken. - Choose
groupPolicyanddmsettings. - Start the gateway:
flowly gateway.