@@ -80,6 +80,15 @@ to login to the new workspace, make sure you go ahead and do that.
8080If you're having a hard time figuring this out, try checking out the following
8181Slack article [ Create a Slack Workspace] ( https://slack.com/intl/en-ca/help/articles/206845317-Create-a-Slack-workspace ) .
8282
83+ #### Create expected channels
84+ Several of Pybot's features involve sending messages to specific channels - in order
85+ for this to work in your personal Slack workspace you'll need to create the following channels:
86+ - mentors-internal
87+ - greetings
88+ - moderators
89+ - oc-tech
90+
91+
8392### 2 - Create a pybot App in Your Slack Workspace
8493
8594The next step is to create a new bot application in your workspace. While still
@@ -91,6 +100,14 @@ following this, follow the guidelines for creating a bot app as laid out in the
91100you get to the stage of creating the bot user, make sure to write down the bot
92101user OAuth access token that is presented, as you'll need to use it later.
93102
103+ On the ` OAuth & Permissions ` page configure the Pybot app with the following scopes
104+
105+ - channels: manage
106+ - chat: write
107+ - chat: write .public
108+ - commands
109+ - users: read
110+
94111### 3 - Launch pybot Locally, Passing in Your Signing Secret
95112
96113With your Slack workspace, app and bot user created, and your app signing secret
@@ -108,7 +125,7 @@ Here's an example of configuring these through the _pybot.env_ file:
108125
109126``` bash
110127SLACK_BOT_SIGNING_SECRET=APP-SIGNING-SECRET
111- BOT_OATH_TOKEN =BOT-USER-OAUTH-TOKEN
128+ BOT_USER_OAUTH_ACCESS_TOKEN =BOT-USER-OAUTH-TOKEN
112129```
113130
114131** NOTE** : More configuration settings than these may be specified. Please see
@@ -118,24 +135,34 @@ for details on other settings that can be set.
118135### 4 - Attach Your pybot Instance to the Public Internet
119136
120137With an instance of pybot running, you now need to expose this instance to the
121- public internet so Slack can send in API requests. You can easily utilize serveo
122- for this purpose if you wish. To do so; run the following command from your UNIX
123- like workstation to setup an SSH port tunnel to serveo :
138+ public internet so Slack can send in API requests. You can easily utilize ngrok
139+ for this purpose if you wish. To do so; download ngrok from https://ngrok.com/download
140+ and set up a tunnel like so :
124141
125142``` bash
126- ssh -R 80:localhost: 5000 serveo.net
143+ ngrok http 5000
127144```
128145
129146Pay attention to copy out the response you get and keep this command running.
130147Here's an example output from the command:
131148
132- ``` text
133- Forwarding HTTP traffic from https://supersecret.serveo.net
134- Press g to start a GUI session and ctrl-c to quit.
149+ ``` bash
150+ ngrok by @inconshreveable (Ctrl+C to quit)
151+ Session Status online
152+ Session Expires 7 hours, 56 minutes
153+ Version 2.3.35
154+ Region United States (us)
155+ Web Interface http://127.0.0.1:4040
156+ Forwarding http://9d73595a7aac.ngrok.io -> http://localhost:5000
157+ Forwarding https://9d73595a7aac.ngrok.io -> http://localhost:5000
158+ Connections ttl opn rt1 rt5 p50 p90
159+ 0 1 0.00 0.00 0.00 0.00
160+ HTTP Requests
135161```
136162
137- With this done, serveo will now expose the instance of pybot running locally
138- on port 5000 on port 443 via the Base-URI it returns.
163+ With this done, ngrok will now expose the instance of pybot running locally
164+ on port 5000 via the "Forwarding" address it returns. Be sure to use the URL
165+ beginning with http** s** .
139166
140167### 5 - Point Slack at Your Running pybot Instance
141168
@@ -166,7 +193,7 @@ subscriptions. When configuring your events URI; make sure you pass in the
166193Base-URI that pybot is listening on followed by the text _ /slack/events_ . For
167194example:
168195
169- https://supersecret.serveo.net /slack/events
196+ https://123_random_code_321.ngrok.io /slack/events
170197
171198#### Slash Commands
172199
@@ -176,7 +203,7 @@ page on Slack to setup pybot slash commands. When configuring a Slash command,
176203make sure you configure the request URL to match the Base-URI that pybot is
177204listening on followed by the text _ /slack/commands_ . For example:
178205
179- https://supersecret.serveo.net /slack/commands
206+ https://123_random_code_321.ngrok.io /slack/commands
180207
181208You'll use the same URI for each command. Here's a table listing of currently
182209supported commands along with some suggested configuration text:
@@ -191,6 +218,16 @@ Command | Description | Usage Hint
191218/roll | roll x dice with y sides | <XdY >
192219/ticket | submit ticket to admins | (text of ticket)
193220
221+
222+ ** 👋 IMPORTANT!**
223+
224+ The ` /lunch ` command requires a valid Yelp API token stored in the ` YELP_TOKEN `
225+ environment variable. See https://www.yelp.com/developers/faq
226+
227+ Similarly, the ` /mentor ` and ` /mentor-volunteer ` commands require access to an Airtable
228+ environment with a specific configuration. If you're planning on working with the mentor
229+ functionality please reach out to the ` #oc-python-projects ` channel for help getting set up.
230+
194231#### Interactive Components
195232
196233You can follow the instructions (and read helpful related information) on the
@@ -199,7 +236,7 @@ page on Slack to setup Slack interactive component configuration. When
199236configuring the request URL, you'll want to set it to the Base-URI that pybot
200237is listening on followed by the text _ /slack/actions_ . For example:
201238
202- https://supersecret.serveo.net /slack/actions
239+ https://123_random_code_321.ngrok.io /slack/actions
203240
204241You'll also want to make sure to configure the report message action with the
205242following parameters:
@@ -218,8 +255,7 @@ list with more details via a PR:
218255Name | Description | Example
219256---- | ----------- | -------
220257SLACK_BOT_SIGNING_SECRET | The unique signing secret used by Slack for a specific app that will be validated by pybot when inspecting an inbound API request | f3b4d774b79e0fb55af624c3f376d5b4
221- BOT_OATH_TOKEN | The bot user specific OAuth token used to authenticate the bot when making API requests to Slack | xoxb-800506043194-810119867738-vRvgSc3rslDUgQakFbMy3wAt
222- MENTOR_CHANNEL | Slack unique identifier (not the same as the channel name) for a workspace channel that mentors should be added to | G1DRT62UC
258+ BOT_USER_OAUTH_ACCESS_TOKEN | The bot user specific OAuth token used to authenticate the bot when making API requests to Slack | xoxb-800506043194-810119867738-vRvgSc3rslDUgQakFbMy3wAt
223259
224260## License
225261This package is available as open source under the terms of the [ MIT License] ( http://opensource.org/licenses/MIT ) .
0 commit comments