You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-39Lines changed: 20 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,63 +83,44 @@ Slack Bot Setup
83
83
SEURON supports two connection modes for its Slack bot: **Socket Mode** (recommended) and **RTM** (legacy).
84
84
85
85
### Socket Mode (Recommended)
86
-
Socket Mode uses a WebSocket connection managed through an app-level token. It works with modern Slack apps and does not require a public URL or classic bot tokens.
87
-
88
-
#### 1. Create a Slack App
89
-
1. Go to [https://api.slack.com/apps](https://api.slack.com/apps) and click **Create New App** > **From scratch**
90
-
2. Name the app (e.g. `seuron`) and select your workspace
91
-
92
-
#### 2. Enable Socket Mode
93
-
1. In the app settings, go to **Settings** > **Socket Mode**
94
-
2. Toggle **Enable Socket Mode** on
95
-
3. When prompted, create an app-level token with the `connections:write` scope
96
-
4. Save the generated token (starts with `xapp-`) -- this is your `SLACK_APP_TOKEN`
97
-
98
-
#### 3. Subscribe to Events
99
-
1. Go to **Features** > **Event Subscriptions** and toggle **Enable Events** on
100
-
2. Under **Subscribe to bot events**, add the following events:
101
-
*`message.channels` -- messages in public channels
102
-
*`message.groups` -- messages in private channels
103
-
*`message.im` -- direct messages
104
-
*`message.mpim` -- group direct messages
105
-
*`reaction_added` -- emoji reactions
106
-
107
-
#### 4. Configure Bot Token Scopes
108
-
1. Go to **Features** > **OAuth & Permissions**
109
-
2. Under **Scopes** > **Bot Token Scopes**, add:
110
-
*`chat:write` -- send messages
111
-
*`files:read` -- access uploaded files
112
-
*`files:write` -- upload files
113
-
*`users:read` -- look up user display names
114
-
*`reactions:read` -- read emoji reactions
115
-
*`channels:history` -- view messages in public channels
116
-
*`groups:history` -- view messages in private channels
117
-
*`im:history` -- view direct messages
118
-
*`mpim:history` -- view group direct messages
119
-
*`channels:read` -- view basic channel info
120
-
121
-
#### 5. Install the App
86
+
Socket Mode uses a WebSocket connection managed through an app-level token. It works with modern Slack apps and does not require a public URL or classic bot tokens. A pre-built [app manifest](slack_manifest.json) is provided to configure all required permissions and events automatically.
87
+
88
+
#### 1. Create the Slack App from the manifest
89
+
1. Go to [https://api.slack.com/apps?new_app=1](https://api.slack.com/apps?new_app=1) and choose **From an app manifest**
90
+
2. Select your workspace and click **Next**
91
+
3. Choose the **JSON** tab and paste the contents of [`slack_manifest.json`](slack_manifest.json)
92
+
4. Click **Next**, review the summary, then click **Create**
93
+
94
+
This configures Socket Mode, all required bot token scopes, and event subscriptions in one step.
95
+
96
+
#### 2. Generate the App-Level Token
97
+
1. After creating the app, go to **Settings** > **Basic Information**
98
+
2. Scroll down to **App-Level Tokens** and click **Generate Token and Scopes**
99
+
3. Name the token (e.g. `seuron-socket`), add the `connections:write` scope, and click **Generate**
100
+
4. Copy the token (starts with `xapp-`) -- this is your `SLACK_APP_TOKEN`
101
+
102
+
#### 3. Install and get the Bot Token
122
103
1. Go to **Settings** > **Install App** and click **Install to Workspace**
123
104
2. Authorize the requested permissions
124
105
3. Copy the **Bot User OAuth Token** (starts with `xoxb-`) -- this is your `SLACK_TOKEN`
125
106
126
-
#### 6. Configure SEURON
107
+
#### 4. Configure SEURON
127
108
For **local deployment**, the `start_seuronbot.local` script will prompt you for both tokens. Alternatively, set them directly in `.env.local`:
128
109
```
129
110
SLACK_TOKEN=xoxb-your-bot-token
130
111
SLACK_APP_TOKEN=xapp-your-app-level-token
131
112
SLACK_NOTIFICATION_CHANNEL=seuron-alerts
132
113
```
133
114
134
-
For **Google Cloud deployment**, add the app token to`cloud/google/cloud-deployment.yaml`:
115
+
For **Google Cloud deployment**, set the tokens in`cloud/google/cloud-deployment.yaml`:
135
116
```yaml
136
117
slack:
137
118
botToken: xoxb-your-bot-token
138
119
appToken: xapp-your-app-level-token
139
120
notificationChannel: seuron-alerts
140
121
```
141
122
142
-
#### 7. Invite the Bot
123
+
#### 5. Invite the Bot
143
124
Invite the bot user to any Slack channels where you want to interact with it, including the notification channel.
0 commit comments