Skip to content

Commit 0c90652

Browse files
committed
docs: clarify info about slack bot token
1 parent 59d8caa commit 0c90652

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Run the `_build/default/src/monorobot.exe` binary. The following commands are su
3636
1. [Create a Slack app](https://api.slack.com/apps?new_app=1).
3737
2. Click "Install to Workspace", and when prompted to grant permissions to your workspace, click "Allow".
3838
3. Set up notifications with one of the following methods:
39-
- **Web API (recommended):** To use Slack's [Web API](https://api.slack.com/web), click on "OAuth & Permissions" in your app dashboard's sidebar. Give your bot a *Bot Token Scope* of [`chat:write`](https://api.slack.com/scopes/chat:write) (for per-channel authorization) or [`chat:write.public`](https://api.slack.com/scopes/chat:write.public) (for authorization to all channels). Copy the generated OAuth access token (`xoxb-XXXX`) to the `slack_access_token` field of your secrets file. This token is used by the bot to authenticate to the workspace, and remains valid until the token is revoked or the app is uninstalled. If you use the `chat:write` scope, add the bot to each channel you want to notify.
39+
- **Web API (recommended):** To use Slack's [Web API](https://api.slack.com/web), click on "OAuth & Permissions" in your app dashboard's sidebar. Give your bot a *Bot Token Scope* of [`chat:write`](https://api.slack.com/scopes/chat:write) (for per-channel authorization) or [`chat:write.public`](https://api.slack.com/scopes/chat:write.public) (for authorization to all channels). Copy the generated bot token (`xoxb-XXXX`) to the `slack_access_token` field of your secrets file. This token is used by the bot to authenticate to the workspace, and remains valid until the token is revoked or the app is uninstalled. If you use the `chat:write` scope, add the bot to each channel you want to notify.
4040
- **Incoming Webhooks:** To use [incoming webhooks](https://api.slack.com/messaging/webhooks), enable them in your app dashboard and create one for each channel you want to notify. Store them in the `slack_hooks` field of your secrets file. If you decide to notify additional channels later, you will need to update the secrets file with the new webhooks and restart the server.
4141

4242

documentation/secret_docs.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ Required for:
3737
- Notification sending via Web API
3838
- Link unfurling
3939

40-
Refer [here](https://api.slack.com/authentication/oauth-v2) for obtaining an access token via OAuth.
40+
You can obtain a bot token from the "OAuth & Permissions" in your app dashboard's sidebar. Note that you need a *bot* token (`xoxb-XXXX`), not a *user* token (`xoxp-XXXX`).
41+
See [here](https://api.slack.com/authentication/basics#start) for creating/installing an app and requesting scopes.
42+
43+
Give it the following scopes:
44+
- For notifications - [`chat:write`](https://api.slack.com/scopes/chat:write) (per-channel authorization) or [`chat:write.public`](https://api.slack.com/scopes/chat:write.public) (authorization to all channels)
45+
- Note: If you use the `chat:write` scope, add the bot to each channel you want to notify.
46+
- For link unfurling - [`links:read`](https://api.slack.com/scopes/links:read) and [`links:write`](https://api.slack.com/scopes/links:write) (also see **Link Unfurling** in main README)
4147

4248
## `slack_hooks`
4349

lib/config.atd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type secrets = {
4545
?gh_hook_token : string nullable;
4646
(* list of Slack webhook & channel name pairs *)
4747
~slack_hooks <ocaml default="[]"> : webhook list;
48-
(* Slack bot token obtained via OAuth, enabling message posting to the workspace *)
48+
(* Slack bot token (`xoxb-XXXX`), giving the bot capabilities to interact with the workspace *)
4949
?slack_access_token : string nullable;
5050
(* Slack uses this secret to sign requests; provide to verify incoming Slack requests *)
5151
?slack_signing_secret : string nullable;

0 commit comments

Comments
 (0)