Skip to content

Commit 406dc92

Browse files
zimeglukegalbraithrussellmwbrooks
authored
docs: guide building an app tutorial using the slack cli (#2597)
Co-authored-by: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> Co-authored-by: Michael Brooks <mbrooks@slack-corp.com>
1 parent 9337e06 commit 406dc92

File tree

10 files changed

+333
-212
lines changed

10 files changed

+333
-212
lines changed

docs/english/building-an-app.md

Lines changed: 301 additions & 175 deletions
Large diffs are not rendered by default.

docs/english/concepts/message-listening.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Listening to messages
22

3-
To listen to messages that [your app has access to receive](https:///messaging/retrieving#permissions), you can use the `message()` method which filters out events that aren’t of type `message` .A `message()` listener is equivalent to `event('message')`
3+
To listen to messages that [your app has access to receive](/messaging/retrieving-messages/#permissions), you can use the `message()` method which filters out events that aren’t of type `message`. A `message()` listener is equivalent to `event('message')`.
44

55
The `message()` listener accepts an optional `pattern` parameter of type `string` or `RegExp` object which filters out any messages that don’t match the pattern.
66

docs/english/deployments/aws-lambda.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ When you’re finished, you’ll have this ⚡️[Deploying to AWS Lambda app](h
1818

1919
If you don't already have an account, you should [sign up for AWS](https://aws.amazon.com/) and follow the on-screen instructions.
2020

21-
:::info
21+
:::info
2222

2323
You may be asked for payment information during the sign up. Don't worry, this guide only uses the [free tier](https://aws.amazon.com/lambda/pricing/).
2424

@@ -30,7 +30,7 @@ Next, you'll need programmatic access to your AWS account to deploy onto Lambda.
3030

3131
We recommend watching this short, step-by-step video to 🍿 [create an IAM user and download the access keys](https://www.youtube.com/watch?v=KngM5bfpttA).
3232

33-
:::tip[Do you already have an IAM user?]
33+
:::tip[Do you already have an IAM user?]
3434

3535
Follow the official AWS guide to [create access keys for existing IAM users](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-creds).
3636

@@ -82,10 +82,10 @@ You're now set up with the Serverless tools! Let's move on to preparing your Bol
8282

8383
## Get a Bolt Slack app {#get-a-bolt-slack-app}
8484

85-
If you haven't already built your own Bolt app, you can use our [Getting Started guide](/tools/bolt-js/getting-started) or clone the template app below:
85+
If you haven't already built your own Bolt app, you can use our [Quickstart guide](/tools/bolt-js/getting-started) or clone the template app below:
8686

8787
```shell
88-
git clone https://github.com/slackapi/bolt-js-getting-started-app.git
88+
git clone https://github.com/slack-samples/bolt-js-getting-started-app.git
8989
```
9090

9191
After you have a Bolt app, navigate to its directory:
@@ -115,7 +115,7 @@ const app = new App({
115115

116116
Next, we'll customize your Bolt app's [`receiver`](/tools/bolt-js/concepts/receiver) to respond to Lambda function events.
117117

118-
Update the [source code that imports your modules](https://github.com/slackapi/bolt-js-getting-started-app/blob/4c29a21438b40f0cbca71ece0d39b356dfcf88d5/app.js#L1) in `app.js` to require Bolt's AwsLambdaReceiver:
118+
Update the [source code that imports your modules](https://github.com/slack-samples/bolt-js-getting-started-app/blob/4c29a21438b40f0cbca71ece0d39b356dfcf88d5/app.js#L1) in `app.js` to require Bolt's AwsLambdaReceiver:
119119

120120
```javascript
121121
const { App, AwsLambdaReceiver } = require('@slack/bolt');
@@ -127,7 +127,7 @@ If implementing authentication with OAuth, you must use the [`ExpressReceiver`](
127127

128128
:::
129129

130-
Then update the [source code that initializes your Bolt app](https://github.com/slackapi/bolt-js-getting-started-app/blob/4c29a21438b40f0cbca71ece0d39b356dfcf88d5/app.js#L10-L14) to create a custom receiver using AwsLambdaReceiver:
130+
Then update the [source code that initializes your Bolt app](https://github.com/slack-samples/bolt-js-getting-started-app/blob/4c29a21438b40f0cbca71ece0d39b356dfcf88d5/app.js#L10-L14) to create a custom receiver using AwsLambdaReceiver:
131131

132132
```javascript
133133
// Initialize your custom receiver
@@ -151,7 +151,7 @@ const app = new App({
151151
});
152152
```
153153

154-
Finally, at the bottom of your app, update the [source code that starts the HTTP server](https://github.com/slackapi/bolt-js-getting-started-app/blob/main/app.js#L47-L52) to now respond to an AWS Lambda function event:
154+
Finally, at the bottom of your app, update the [source code that starts the HTTP server](https://github.com/slack-samples/bolt-js-getting-started-app/blob/main/app.js#L47-L52) to now respond to an AWS Lambda function event:
155155

156156
```javascript
157157
// Handle the Lambda function event
@@ -189,11 +189,11 @@ plugins:
189189
- serverless-offline
190190
```
191191
192-
:::info
192+
:::info
193193
194194
`SLACK_SIGNING_SECRET` and `SLACK_BOT_TOKEN` must be environment variables on your local machine.
195195

196-
You can [learn how to export Slack environment variables](/tools/bolt-js/getting-started#setting-up-your-project) in our Getting Started guide.
196+
You can [learn how to export Slack environment variables](/tools/bolt-js/getting-started#creating-a-project) in our Quickstart guide.
197197

198198
:::
199199

@@ -233,9 +233,9 @@ Next, use ngrok to forward Slack events to your local machine:
233233
ngrok http 3000
234234
```
235235

236-
:::info
236+
:::info
237237

238-
[Learn how to use ngrok](/tools/bolt-js/getting-started#setting-up-events) to create a public URL and forward requests to your local machine.
238+
[Learn how to use ngrok](/tools/bolt-js/building-an-app#preparing-receive-events) to create a public URL and forward requests to your local machine.
239239

240240
:::
241241

@@ -255,7 +255,7 @@ Second, select **Event Subscriptions** from the side and update the **Request UR
255255

256256
### 3. Test your Slack app
257257

258-
Now you can test your Slack app by inviting your app to a channel then saying “hello” (lower-case). Just like in the [Getting Started guide](/tools/bolt-js/getting-started), your app should respond back:
258+
Now you can test your Slack app by inviting your app to a channel then saying “hello” (lower-case). Just like in the [Quickstart guide](/tools/bolt-js/getting-started#running-the-app), your app should respond back:
259259

260260
```
261261
> 👩‍💻 hello
@@ -360,4 +360,4 @@ Now that you've built and deployed a basic app, here are some ideas you can expl
360360
- Brush up on [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) and the [Serverless Framework](https://www.serverless.com/framework/docs/providers/aws/guide/intro/).
361361
- Extend your app with other Bolt capabilities and [Serverless plugins](https://www.serverless.com/framework/docs/providers/aws/guide/plugins/).
362362
- Learn about [logging](/tools/bolt-js/concepts/logging) and how to [view log messages with Serverless](https://www.serverless.com/framework/docs/providers/aws/cli-reference/logs/).
363-
- Get ready for primetime with AWS Lambda [testing](https://www.serverless.com/framework/docs/providers/aws/guide/testing/) and [deployment environments](https://www.serverless.com/framework/docs/providers/aws/guide/deploying/).
363+
- Get ready for primetime with AWS Lambda [testing](https://www.serverless.com/framework/docs/providers/aws/guide/testing/) and [deployment environments](https://www.serverless.com/framework/docs/providers/aws/guide/deploying/).

docs/english/deployments/heroku.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ When you’re finished, you’ll have this ⚡️[Deploying to Heroku app](https
66

77
:::warning
88

9-
Using Heroku dynos to complete this tutorial counts towards your usage. [Delete your app](https://devcenter.heroku.com/articles/heroku-cli-commands#heroku-apps-destroy) as soon as you are done to control costs.
9+
Using Heroku dynos to complete this tutorial counts towards your usage. [Delete your app](https://devcenter.heroku.com/articles/heroku-cli-commands#heroku-apps-destroy) as soon as you are done to control costs.
1010

1111
:::
1212

1313
---
1414

1515
## Get a Bolt Slack app {#get-a-bolt-slack-app}
1616

17-
If you haven't already built your own Bolt app, you can use our [Getting Started guide](/tools/bolt-js/getting-started) or clone the template app below:
17+
If you haven't already built your own Bolt app, you can use our [Quickstart guide](/tools/bolt-js/getting-started) or clone the template app below:
1818

1919
```shell
20-
git clone https://github.com/slackapi/bolt-js-getting-started-app.git
20+
git clone https://github.com/slack-samples/bolt-js-getting-started-app.git
2121
```
2222

2323
After you have a Bolt app, navigate to its directory:
@@ -36,7 +36,7 @@ Heroku is a flexible platform that requires some configuration to host your app.
3636

3737
### 1. Use a Git repository
3838

39-
:::info
39+
:::info
4040

4141
Skip this step if you used `git clone` in the previous section because you already have a Git repository.
4242

@@ -69,7 +69,7 @@ git add Procfile
6969
git commit -m "Add Procfile"
7070
```
7171

72-
:::info
72+
:::info
7373

7474
Are you following this guide with an existing Bolt app? If so, please review the guide on [preparing a codebase for Heroku](https://devcenter.heroku.com/articles/preparing-a-codebase-for-heroku-deployment#4-listen-on-the-correct-port) to listen on the correct port.
7575

@@ -106,7 +106,8 @@ The Heroku CLI connects your local machine with your Heroku account. [Sign up fo
106106
```shell
107107
heroku login
108108
```
109-
:::warning
109+
110+
:::warning
110111

111112
If you're behind a firewall, you may need to [set the proxy environment variables](https://devcenter.heroku.com/articles/using-the-cli#using-an-http-proxy) for the Heroku CLI.
112113

@@ -181,9 +182,9 @@ heroku config:set SLACK_SIGNING_SECRET=<your-signing-secret>
181182
heroku config:set SLACK_BOT_TOKEN=xoxb-<your-bot-token>
182183
```
183184

184-
:::info
185+
:::info
185186

186-
If you don't know where to find your credentials, please read about [exporting your signing secret and token](/tools/bolt-js/getting-started#tokens-and-installing-apps) in the Getting Started guide.
187+
If you don't know where to find your credentials, please read about [exporting your signing secret and token](/tools/bolt-js/building-an-app#preparing-receive-events) in the Building an app guide.
187188

188189
:::
189190

@@ -205,7 +206,7 @@ You can now deploy your app with the command:
205206
git push heroku main
206207
```
207208

208-
:::info
209+
:::info
209210

210211
Heroku deploys code that's pushed to the [master or main branches](https://devcenter.heroku.com/articles/git-branches). Pushing to other branches will not trigger a deployment.
211212

@@ -253,7 +254,7 @@ Second, select **Event Subscriptions** from the side and update the **Request UR
253254

254255
Your app is now deployed and Slack is updated, so let's try it out!
255256

256-
Open a Slack channel that your app has joined and say "hello" (lower-case). Just like in the [Getting Started guide](/tools/bolt-js/getting-started#sending-and-responding-to-actions), your app should respond back. If you don't receive a response, check your **Request URL** and try again.
257+
Open a Slack channel that your app has joined and say "hello" (lower-case). Just like in the [Quickstart guide](/tools/bolt-js/getting-started#running-the-app), your app should respond back. If you don't receive a response, check your **Request URL** and try again.
257258

258259
---
259260

@@ -296,4 +297,4 @@ Now that you've deployed a basic app, you can start exploring how to customize a
296297
- Brush up on [how Heroku works](https://devcenter.heroku.com/articles/how-heroku-works) and understand the [limitations of a Heroku Eco Dyno app](https://devcenter.heroku.com/articles/eco-dyno-hours).
297298
- Extend your app with with other Bolt capabilities and and [Heroku's Add-ons](https://elements.heroku.com/addons).
298299
- Learn about [logging](/tools/bolt-js/concepts/logging) and how to [view log messages in Heroku](https://devcenter.heroku.com/articles/getting-started-with-nodejs#view-logs).
299-
- Get ready for primetime with [how to scale your Heroku app](https://devcenter.heroku.com/articles/getting-started-with-nodejs#scale-the-app).
300+
- Get ready for primetime with [how to scale your Heroku app](https://devcenter.heroku.com/articles/getting-started-with-nodejs#scale-the-app).

docs/english/getting-started.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ sidebar_label: Quickstart
66

77
This quickstart guide aims to help you get a Slack app using Bolt for JavaScript up and running as soon as possible!
88

9-
import Tabs from '@theme/Tabs';
10-
import TabItem from '@theme/TabItem';
11-
129
When complete, you'll have a local environment configured with a customized [app](https://github.com/slack-samples/bolt-js-getting-started-app) running that responds to a simple greeting.
1310

1411
:::tip[Reference for readers]

docs/english/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Bolt for JavaScript
22

3-
Bolt for JavaScript is a JavaScript framework to build Slack apps with the latest Slack platform features. Read the [Getting Started Guide](/tools/bolt-js/getting-started) to set up and run your first Bolt app.
3+
Bolt for JavaScript is a JavaScript framework to build Slack apps with the latest Slack platform features. Read the [Quickstart Guide](/tools/bolt-js/getting-started) to set up and run your first Bolt app.
44

55
Then, explore the rest of the pages within the Guides section. The documentation there will help you build a Bolt app for whatever use case you may have.
66

@@ -18,4 +18,4 @@ If you otherwise get stuck, we're here to help. The following are the best ways
1818
These docs live within the [Bolt-JS](https://github.com/slackapi/bolt-js/) repository and are open source.
1919

2020
We welcome contributions from everyone! Please check out our
21-
[Contributor's Guide](https://github.com/slackapi/bolt-js/blob/main/.github/contributing.md) for how to contribute in a helpful and collaborative way.
21+
[Contributor's Guide](https://github.com/slackapi/bolt-js/blob/main/.github/contributing.md) for how to contribute in a helpful and collaborative way.

docs/english/legacy/hubot-migration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ The [Events API](/legacy/legacy-bot-users#handling-events) is a bot's equivalent
4747

4848
:::info
4949

50-
Before you configure your bot’s events, you’ll need a public URL. If you’ve never created a Bolt for JavaScript app or never used the Events API, it’d be helpful to go through [setting up your local Bolt project](/tools/bolt-js/getting-started) and [setting up events](/tools/bolt-js/getting-started#setting-up-events) in the Getting Started guide.
50+
Before you configure your bot’s events, you’ll need a public URL. If you’ve never created a Bolt for JavaScript app or never used the Events API, it’d be helpful to go through [setting up your local Bolt project](/tools/bolt-js/building-an-app) and [setting up events](/tools/bolt-js/building-an-app#preparing-receive-events) in the Getting Started guide.
5151

5252
:::
5353

5454
### Listening for messages
5555
All Hubot apps can listen to messages by default, so we need to configure your bot user to do the same.
5656

57-
After walking through [setting up events](/tools/bolt-js/getting-started#setting-up-events), your Request URL should be verified. Scroll down to **Subscribe to Bot Events**. There are four events related to messages: `message.channels` (listens for messages in public channels), `message.groups` (listens for messages in private channels), `message.im` (listens for messages in the App Home/DM space), and `message.mpim` (listens for messages in multi-person DMs).
57+
After walking through [setting up events](/tools/bolt-js/building-an-app#preparing-receive-events), your Request URL should be verified. Scroll down to **Subscribe to Bot Events**. There are four events related to messages: `message.channels` (listens for messages in public channels), `message.groups` (listens for messages in private channels), `message.im` (listens for messages in the App Home/DM space), and `message.mpim` (listens for messages in multi-person DMs).
5858

5959
If you only want your bot to listen to messages in channels, you can listen to `message.channels` and `message.groups`. Or if you want your bot to listen to messages from everywhere it is, choose all four message events.
6060

docs/english/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_label: Reference
44

55
# Bolt for JavaScript interface and configuration reference
66

7-
This guide is intended to detail the Bolt interface–including listeners and their arguments, initialization options, and errors. It may be helpful to first go through the ⚡️[Getting Started guide](/tools/bolt-js/getting-started) to learn the basics of building Bolt for JavaScript apps.
7+
This guide is intended to detail the Bolt interface–including listeners and their arguments, initialization options, and errors. It may be helpful to first go through the ⚡️[Building an app guide](/tools/bolt-js/building-an-app) to learn the basics of building Bolt for JavaScript apps.
88

99
---
1010

docs/english/tutorials/custom-steps-workflow-builder-new/custom-steps-workflow-builder-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ All of your app's settings can be configured within these screens. By creating a
6868

6969
Navigate to **Event Subscriptions** and expand **Subscribe to bot events** to see that we have subscribed to the `function_executed` event. This is also a requirement for adding workflow steps to our app, as it lets our app know when a step has been triggered, allowing our app to respond to it.
7070

71-
Another configuration setting to note is **Socket Mode**. We have turned this on for our local development, but socket mode is not intended for use in a production environment. When you are satisfied with your app and ready to deploy it to a production environment, you should switch to using public HTTP request URLs. Read more about getting started with HTTP in [Bolt for JavaScript here](/tools/bolt-js/getting-started).
71+
Another configuration setting to note is **Socket Mode**. We have turned this on for our local development, but socket mode is not intended for use in a production environment. When you are satisfied with your app and ready to deploy it to a production environment, you should switch to using public HTTP request URLs. Read more about getting started with HTTP in [Bolt for JavaScript here](/tools/bolt-js/building-an-app).
7272

7373
Clicking on **Workflow Steps** in the left nav will show you that one workflow step has been added! This reflects the `function` defined in our manifest: functions are workflow steps. We will get to this step's implementation later.
7474

docs/japanese/getting-started.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ node app.js
131131

132132
Slack ワークスペースで発生するイベント(メッセージが投稿されたときや、メッセージに対するリアクションがつけられたときなど)をリッスンするには、[Events API を使って特定の種類のイベントをサブスクライブします](/apis/events-api/)
133133

134-
import Tabs from '@theme/Tabs';
135-
import TabItem from '@theme/TabItem';
136-
137134
<Tabs groupId="socket-or-http">
138135
<TabItem value="socket-mode" label="Socket Mode">
139136

0 commit comments

Comments
 (0)