slack
This document describes how to create a Slack app, send messages that mention @Bot in channels or direct messages to Tencent Cloud EdgeOne Makers through the Events API, and return the result to the original channel or direct message conversation after the Agent processes it.
Prerequisites and Scope of Application
1. You must have a Slack account and a test workspace, along with permissions to create and install apps. If your organization restricts app installation, administrator approval is required.
2. Makers has been activated.
3. The Makers deployment domain can be accessed from the Slack public network, and the service can access the Slack API and model services.
4. This document verifies text direct messages and channel mentions within the workspace. Each round of channel questions must @Bot.
Creating an Application
1. Log in to the Slack App Management page and click Create New App.
2. Select Blank app, click Continue, and enter the app name in App Name, such as
Makers Assistant.3. Select the test workspace in Workspace and click Create.
4. Go to Basic Information > App Credentials, display and copy the Signing Secret.

Configuring Least Privilege and Installing the Application
1. Go to OAuth & Permissions > Scopes > Bot Token Scopes.
2. Click Add an OAuth Scope and add the permissions according to the following table.
Scope | Purpose | Configuration Requirements |
chat:write | Send placeholder messages and update them as Agent replies. | Required. |
app_mentions:read | Receive events in channels where @Bot is mentioned. | Required when a mention is made in test channels. |
im:history | Receive direct message events between users and the Bot. | Required when direct messages are tested. |
users:read | The Adapter obtains user profile information such as display names. | Optional. You can omit this scope if user profile information is not required. |
3. In OAuth & Permissions, click Install to Workspace, verify the workspace and permissions, and complete the authorization.
4. Copy the Bot User OAuth Token, which has the prefix
xoxb-.5. To test direct messages, go to App Home, enable Messages Tab in Show Tabs to allow users to send messages to the app from this tab. See App Home.
Deploying the Makers Template
1. Open the Makers Agent for IM template.
2. In the project environment variable settings, fill in the following variables (copy .env.example to .env).
Environment Variable | Required | Description |
SLACK_BOT_TOKEN | Yes | Bot User OAuth Token |
SLACK_SIGNING_SECRET | Yes | Signing Secret |
3. Save the configuration and deploy it.
4. Copy the production HTTPS domain name, and append /slack to the end.
5. Note that the service should be deployed in a global AZ so that slack services can be accessed correctly.
Configuring Event Subscriptions
1. Return to the Slack App Management page, go to Event Subscriptions, and enable Enable Events.
2. In Request URL, enter the address from step 3.
3. Wait for Verified to appear next to the address. The template will return the
challenge sent by Slack.4. In Subscribe to bot events, click Add Bot User Event and add the events listed in the following table.
Event | Receiving content | Corresponding Scope |
app_mention | Messages from users in channels where @Bot is mentioned. | app_mentions:read |
message.im | Direct messages sent by users to the Bot. | im:history |
5. Click Save Changes. If you are prompted that permissions have changed, return to OAuth & Permissions and reinstall the authorization.
6. Open the test channel in the Slack client, enter
/invite, select the app, and invite the Bot to the channel. Private channels must be invited by members with the required permissions.
For configuration details, see HTTP Request URL. This process does not require configuring Socket Mode or Interactivity, nor does it require subscribing to regular channel messages. Subscribing to events cannot replace adding the Bot to a channel.
Sending a Message and Verifying It
1. In a channel that the Bot has joined, enter
@, select the Bot from the candidate list, and send Please introduce Tencent Cloud EdgeOne Makers in one sentence..2. Confirm that
Thinking… appears in the channel, and then the same message is updated with the Agent's final reply.3. @Bot again, send
Please shorten the previous answer to no more than ten words., and confirm that you receive the second-round reply.

