Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 2bde8ad

Browse files
committed
Regression. Remove workspace app mentions.
1 parent 3bcdda3 commit 2bde8ad

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Slash Command and Dialogs blueprint
22

3-
> :sparkles: *Updated August 2018: As we have introduced the workspace app (currently in beta), this tutorial and the code samples have been updated using the new token model! All the changes from the previous version of this example, read the [DIFF.md](DIFF.md)*
4-
5-
*Learn more about the workspace app at the [Slack API doc](https://api.slack.com/workspace-apps-preview).*
3+
> :sparkles: *Updated October 2018: As we have introduced some new features, this tutorial and the code samples have been updated! All the changes from the previous version of this example, read the DIFF.md*
64
75
## Creating a helpdesk ticket using a Slash Command and a Dialog
86

@@ -14,15 +12,17 @@ Use a slash command and a dialog to create a helpdesk ticket in a 3rd-party syst
1412

1513
#### Create a Slack app
1614

17-
1. Create a *workspace app* at [https://api.slack.com/apps?new_app_token=1](https://api.slack.com/apps?new_app_token=1)
15+
1. Create an app at [https://api.slack.com/apps](https://api.slack.com/apps)
1816
2. Add a Slash command (See *Add a Slash Command* section below)
19-
3. Enable Interactive components (See *Enable Interactive Components* below)
20-
4. Navigate to the **OAuth & Permissions** page and add the following scopes:
17+
3. Navigate to **Bot Users** and click "Add a Bot User" to create one.
18+
4. Enable Interactive components (See *Enable Interactive Components* below)
19+
5. Navigate to the **OAuth & Permissions** page and add the following scopes:
2120
* `commands`
21+
* `bot`
2222
* `users:read`
2323
* `users:read.email`
24-
* `chat:write`
25-
5. Click 'Save Changes' and install the app (You should get an OAuth access token after the installation)
24+
* `chat:write:bot`
25+
6. Click 'Save Changes' and install the app (You should get an OAuth access token after the installation)
2626

2727
#### Add a Slash Command
2828
1. Go back to the app settings and click on Slash Commands.
@@ -31,20 +31,20 @@ Use a slash command and a dialog to create a helpdesk ticket in a 3rd-party syst
3131
* Request URL: Your ngrok or Glitch URL + `/command`
3232
* Short description: `Create a helpdesk ticket`
3333
* Usage hint: `[the problem you're having]`
34-
1. Save and reinstall the app
3534

36-
If you are using Glitch, the Request URL should look like: `https://slack-slash-command-and-dialogs-blueprint.glitch.me/command`.
35+
If you are using Glitch, the Request URL should look like: `https://my-slash-comm-app.glitch.me/command`.
3736

3837

3938
#### Enable Interactive Components
4039
1. Go back to the app settings and click on Interactive Components.
41-
1. Set the Request URL to your server (*e.g.* `https://yourname.ngrok.com`) or Glitch URL + `/interactive-component`
40+
1. Set the Request URL to your server (*e.g.* `https://yourname.ngrok.com`) or Glitch URL + `/interactive`.
41+
1. Save the change.
4242

4343
#### Run the app locally or [![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/remix/slack-slash-command-and-dialogs-blueprint)
4444
1. Get the code
4545
* Either clone this repo and run `npm install`
4646
* Or visit https://glitch.com/edit/#!/remix/slack-slash-command-and-dialogs-blueprint
4747
2. Set the following environment variables to `.env` (see `.env.sample`):
48-
* `SLACK_ACCESS_TOKEN`: Your app's `xoxa-` token (available on the ****OAuth & Permissions** once you install the app)
48+
* `SLACK_ACCESS_TOKEN`: Your bot token, `xoxb-` (available on the **OAuth & Permissions** once you install the app)
4949
* `SLACK_SIGNING_SECRET`: Your app's Signing Secret (available on the **Basic Information** page)
50-
3. If you're running the app locally, run the app (`npm start`)
50+
3. If you're running the app locally, run the app (`npm start`). Or if you're using Glitch, it automatically starts the app.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"name": "slash-command-blueprint",
33
"private": true,
4-
"version": "2.0.0",
4+
"version": "1.5.0",
55
"description": "Sample Slack app that responds to an Slack slash command with an interactive message",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"start": "DEBUG=slash-command-template node src/index.js"
99
},
10-
"authors": ["Sachin Ranchod <sranchod@slack-corp.com>", "Tomomi Imura <timura@slack-corp.com>"],
10+
"authors": [
11+
"Sachin Ranchod <sranchod@slack-corp.com>",
12+
"Tomomi Imura <timura@slack-corp.com>"
13+
],
1114
"engines": {
1215
"node": ">=4.2.0",
1316
"npm": ">=2.14.7"

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ app.post('/command', (req, res) => {
9898
* Endpoint to receive the dialog submission. Checks the verification token
9999
* and creates a Helpdesk ticket
100100
*/
101-
app.post('/interactive-component', (req, res) => {
101+
app.post('/interactive', (req, res) => {
102102
const body = JSON.parse(req.body.payload);
103103

104104
// check that the verification token matches expected value

src/ticket.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const sendConfirmation = (ticket) => {
1111
axios.post('https://slack.com/api/chat.postMessage', qs.stringify({
1212
token: process.env.SLACK_ACCESS_TOKEN,
1313
channel: ticket.userId,
14+
as_user: true,
1415
text: 'Helpdesk ticket created!',
1516
attachments: JSON.stringify([
1617
{

0 commit comments

Comments
 (0)