Connecting to Slack
AstrBot v3.5.16 and later supports connecting to the Slack messaging platform.
Create AstrBot Slack Platform Adapter
Navigate to the Bots page, click + Create Bot, find Slack and click to enter the Slack configuration page.

In the configuration dialog that appears, click Enable.
Create an App in Slack
Slack supports two connection methods: Webhook and Socket. If you don't have a public server and your message volume is relatively small, we recommend using the socket method. If you have a public server (or have technical knowledge about setting up tunnels, such as Cloudflare Tunnel), you can choose the webhook method. The socket method is relatively simpler to deploy.
- Create a Slack account and a Workspace.
- Go to Apps Management, click "Create New App" -> "From Scratch", enter the
App Nameand the workspace to add it to, then click "Create App". - (Webhook only) Obtain the
Signing Secret. In the Basic Information page on the left sidebar, findSigning Secretunder App Credentials, click Show and copy it to the signing_secret field in the platform adapter configuration.

- In the Basic Information page on the left sidebar, find App-Level Tokens and click "Generate Token and Scopes". Enter any Token Name, click Add Scope, select
connections:write, then click "Generate". Click Copy and paste the result into the app_token field on the AstrBot configuration page.

In the OAuth & Permissions page on the left sidebar, add the following permissions under Bot Token Scopes:
- channels:history
- channels:read
- channels:write.invites
- chat:write
- chat:write.customize
- chat:write.public
- files:read
- files:write
- groups:history
- groups:read
- groups:write
- im:history
- im:read
- im:write
- reactions:read
- reactions:write
- users:read
In the OAuth & Permissions page on the left sidebar, click
Install to xxxunder OAuth Token (where xxx is your workspace name). Then copy the generated Bot User OAuth Token to the bot_token field in the platform adapter configuration.(Socket only) In the Socket Mode page on the left sidebar, enable Socket Mode.

Start the Platform Adapter
The configuration is now complete. If you're using Socket mode, simply click the Save button in the bottom right corner of the configuration. If you're using Webhook mode, you can also configure the Slack Webhook Host, Slack Webhook Port, and Slack Webhook Path according to your needs. Generally, using the default values is sufficient.
Enable Event Subscriptions
After successfully creating the platform adapter, return to the Slack settings. In the Event Subscriptions page on the left sidebar, click Enable Events to enable event reception.
If you're using Webhook mode, enter https://your-domain/astrbot-slack-webhook/callback in the Request URL field that appears.
TIP
In Webhook mode, you need to first set up your domain with your DNS provider, then use reverse proxy software to proxy the Slack Webhook Port you configured in the previous step to your domain. Alternatively, you can use Cloudflare Tunnel. For detailed tutorials, please refer to online resources; this tutorial will not cover these in detail.
After enabling, under Subscribe to bot events below, click Add Bot User Event and add the following events:
- channel_created
- channel_deleted
- channel_left
- member_joined_channel
- member_left_channel
- message.channels
- message.groups
- message.im
- reaction_added
- reaction_removed
- team_join
Test the Connection
Enter the Slack workspace you just added, navigate to the channel where you want to use the bot, then @ mention the app you just created. Click the Add button in the message subsequently sent by Slackbot to add it to the workspace. Then, @ mention the app and type /help. If it responds successfully, the test is successful.
If you have any questions, please submit an Issue.

