Skip to content

Commit 599dd64

Browse files
committed
First run at a README.md update
1 parent e4953e6 commit 599dd64

File tree

1 file changed

+53
-13
lines changed

1 file changed

+53
-13
lines changed

README.md

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,66 @@ Secondary features :
5454

5555
Bot applications are not allowed to access all api methods from Slack. Thus, if
5656
you create a bot integration on slack, the bot won't be able to create new
57-
channels for example. To get around this restriction, you have to create a real
58-
slack user and generate an authentication token for it, which can then be used
59-
instead of a bot token.
57+
channels for example. To get around this restriction you must create a new
58+
slack integration ("Slack App"), assign it to your workspace, and generate both
59+
a "Bot User Token" and an "App Level Token" (`xoxb` and `xapp1`, respectively).
60+
Once generated, the tokens must be scoped to the appropriate privilege levels
61+
required for the bot to function. Finally, you must ensure that you have
62+
subscribed the bot users to the list of events it will need to receive in order
63+
to operate.
6064

61-
1. Create a new user in slack (this will be the bot user, so give it an appropriate username)
62-
2. Log into slack with this newly created user
63-
3. Navigate to https://api.slack.com/custom-integrations/legacy-tokens
64-
* The user should show up there together with your slack workspace
65-
5. Press "Create token"
66-
* This should create a token starting with "xoxp-"
67-
7. Use this token as the `api_key` for the bot
68-
8. Logout and login with your regular user again.
65+
1) App Level Token
6966

70-
After restarting the bot, the bot user should now show up in your slack workspace.
67+
This token is used by the bot to access the websocket event feed in version 3
68+
of the Slack API. It comes with the `connections:write` scope and that's all
69+
you should need for this particular token. Place this token into the config
70+
file under the entry `app_key`.
71+
72+
2) Bot User Token
73+
74+
This token is used by the bot to interact with the workspace and users via
75+
Slack's conversations API. Once you've created it you will need to authorize it
76+
for the following scopes. Then you will need to put the token into the config
77+
file under the entry `api_key`.
78+
79+
```
80+
app_mentions:read
81+
channels:history
82+
channels:join
83+
channels:manage
84+
channels:read
85+
chat:write
86+
chat:write.customize
87+
chat:write.public
88+
dnd:read
89+
emoji:read
90+
groups:history
91+
groups:read
92+
groups:write
93+
im:history
94+
im:read
95+
im:write
96+
links:read
97+
links:write
98+
mpim:history
99+
mpim:read
100+
mpim:write
101+
pins:read
102+
pins:write
103+
reactions:read
104+
reactions:write
105+
reminders:list
106+
reminders:write
107+
team:read
108+
users:read
109+
users:write
110+
```
71111

72112

73113
## Installation
74114

75115
1. Copy `config/config.json.template` to `config/config.json`
76-
2. Fill the API token and bot name in the config.json file.
116+
2. Fill the APP and API token names in the config.json file.
77117
3. Add your user id (slack id, not the username) to `admin_users` group in `config/config.json`
78118
4. If you want to use the wolfram alpha api, register a valid app id on http://products.wolframalpha.com/api/ and set `wolfram_app_id` in `config/config.json`
79119
5. Copy `intro_msg.template` to `intro_msg` and set a proper introduction message, which can be shown with `!intro`

0 commit comments

Comments
 (0)