From 36e51d41c60fb150cfcbbaa1c80711c1bc535fbc Mon Sep 17 00:00:00 2001 From: Michael Brooks Date: Wed, 16 Sep 2020 16:12:54 -0700 Subject: [PATCH] [#623] 6 minor tweaks to the Getting Started guide for English and Japanese Updates: 1. Update MacOS to macOS (see discussion slackapi/bolt-python#71 (comment)) 2. Updates 130 to 220 Web API methods (see discussion slackapi/bolt-python#71 (comment)) 3. Fix the numbered list formatting because the code blocks cause 1. & 1. rather than 1. & 2. 4. Update the event scopes to be a bullet list (discussed offline with @shaydewael and @misscoded) 5. Update the mention of "Interactive Components" to the new "Interactivity & Shortcuts" wording 6. Update the links in "Next Steps" to be relative to /bolt-js/ Commits: * [docs] Update Getting Started MacOS to macOS - This is the modern naming convention - Thanks @seratch https://github.com/slackapi/bolt-python/pull/71#discussion_r485996903 * [docs] Update Getting Started 130 to 220 Web API methods - Thanks @seratch! https://github.com/slackapi/bolt-python/pull/71#discussion_r486000352 * [docs] Fix Getting Started numbered list formatting * [docs] Update Getting Started event scopes to be displayed as a list * [docs] Update Getting Started to use 'Interactivity & Shortcuts' - Update the mention of side bar name from 'Interactive Components' to 'Interactivity & Shortcuts' * [docs] Update Getting Started links as relative to /bolt-js/ - This aligns with bolt-python docs - Makes the links more explicit to the bolt-js docs * [docs] Update dash to colon in JA Getting Started guide Co-authored-by: Kazuhiro Sera --- docs/_tutorials/getting_started.md | 18 ++++++++++-------- docs/_tutorials/ja_getting_started.md | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/docs/_tutorials/getting_started.md b/docs/_tutorials/getting_started.md index 67ace5e46..33687219d 100644 --- a/docs/_tutorials/getting_started.md +++ b/docs/_tutorials/getting_started.md @@ -67,14 +67,12 @@ You’ll be prompted with a series of questions to describe your new project (yo Before we install the Bolt for JavaScript package to your new project, let's save the bot token and signing secret that was generated when you configured your app. These should be stored as environment variables and should *not* be saved in version control. -1. **Copy your Signing Secret from the Basic Information page** and then store it in a new environment variable. The following example works on Linux and MacOS; but [similar commands are available on Windows](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153). - +1. **Copy your Signing Secret from the Basic Information page** and then store it in a new environment variable. The following example works on Linux and macOS; but [similar commands are available on Windows](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153). ```shell export SLACK_SIGNING_SECRET= ``` 2. **Copy your bot (xoxb) token from the OAuth & Permissions page** and store it in another environment variable. - ```shell export SLACK_BOT_TOKEN=xoxb- ``` @@ -151,7 +149,11 @@ Now you have a public-facing URL for your app that tunnels to your local machine Under the **Enable Events** switch in the **Request URL** box, go ahead and paste in your URL. As long as your Bolt app is still running, your URL should become verified. -After your request URL is verified, scroll down to **Subscribe to Bot Events**. There are four events related to messages: `message.channels` (listens for messages in public channels that your app is added to), `message.groups` (listens for messages in private channels that your app is added to), `message.im` (listens for messages in the App Home/DM space), and `message.mpim` (listens for messages in multi-person DMs that your app is added to). +After your request URL is verified, scroll down to **Subscribe to Bot Events**. There are four events related to messages: +- `message.channels` listens for messages in public channels that your app is added to +- `message.groups` listens for messages in private channels that your app is added to +- `message.im` listens for messages in the App Home/DM space +- `message.mpim` listens for messages in multi-person DMs that your app is added to If you want your bot to listen to messages from everywhere it is added to, choose all four message events. After you’ve selected the events you want your bot to listen to, click the green **Save Changes** button. @@ -194,7 +196,7 @@ This is a basic example, but it gives you a place to start customizing your app To use features like buttons, select menus, datepickers, dialogs, and shortcuts, you’ll need to enable interactivity. Similar to events, you'll need to specify a URL for Slack to send the action (such as *user clicked a button*). -Back on your app configuration page, click on **Interactive Components** on the left side. You'll see that there's another **Request URL** box. +Back on your app configuration page, click on **Interactivity & Shortcuts** on the left side. You'll see that there's another **Request URL** box. By default, Bolt is configured to use the same endpoint for interactive components that it uses for events, so use the same request URL as above (in the example, it was `https://8e8ec2d7.ngrok.io/slack/events`). Press the **Save Changes** button in the lower right hand corner, and that's it. Your app is set up for interactivity! @@ -313,10 +315,10 @@ You just built your first Bolt for JavaScript app! 🎉 Now that you have a basic app up and running, you can start exploring how to make your Bolt app stand out. Here are some ideas about what to explore next: -* Read through the [Basic concepts](https://slack.dev/bolt#basic) to learn about the different methods and features your Bolt app has access to. +* Read through the [Basic concepts](/bolt-js/concepts#basic) to learn about the different methods and features your Bolt app has access to. -* Explore the different events your bot can listen to with the [`events()` method](https://slack.dev/bolt#event-listening). All of the events are listed [on the API site](https://api.slack.com/events). +* Explore the different events your bot can listen to with the [`events()` method](/bolt-js/concepts#event-listening). All of the events are listed [on the API site](https://api.slack.com/events). -* Bolt allows you to [call Web API methods](https://slack.dev/bolt#web-api) with the client attached to your app. There are [over 130 methods](https://api.slack.com/methods) on our API site. +* Bolt allows you to [call Web API methods](/bolt-js/concepts#web-api) with the client attached to your app. There are [over 220 methods](https://api.slack.com/methods) on our API site. * Learn more about the different token types [on our API site](https://api.slack.com/docs/token-types). Your app may need different tokens depending on the actions you want it to perform. diff --git a/docs/_tutorials/ja_getting_started.md b/docs/_tutorials/ja_getting_started.md index da0e1b0a2..e8205240f 100644 --- a/docs/_tutorials/ja_getting_started.md +++ b/docs/_tutorials/ja_getting_started.md @@ -68,14 +68,12 @@ npm init Bolt パッケージを新しいプロジェクトにインストールする前に、アプリの設定時に生成されたボットトークンと signing secret (サイン認証) を保存しましょう。これらは環境変数として保存する必要があります。**バージョン管理では保存しない**でください。 -1. **Basic Information ページから Signing Secret をコピー**して、新しい環境変数に保存します。次の例は Linux と MacOS で動作します。ただし、[Windows でも同様のコマンドが利用可能](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153)です。 - +1. **Basic Information ページから Signing Secret をコピー**して、新しい環境変数に保存します。次の例は Linux と macOS で動作します。ただし、[Windows でも同様のコマンドが利用可能](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153)です。 ```shell export SLACK_SIGNING_SECRET= ``` 2. **OAuth & Permissions ページからボット (xoxb) トークンをコピー**し、それを別の環境変数に格納します。 - ```shell export SLACK_BOT_TOKEN=xoxb- ``` @@ -151,8 +149,11 @@ ngrok http 3000 **Request URL** ボックスの **Enable Events** スイッチの下のフィールドにこの URL を貼り付けます。Bolt アプリが引き続き実行されている場合は、URL が検証されチェックマークが表示されます。 -Request URL が検証されたら、**Subscribe to Bot Events** までスクロールします。メッセージに関するイベントが4つあります− -message.channels (あなたのアプリが追加されているパブリックチャンネルのメッセージをリッスン), message.groups (あなたのアプリが追加されているプライベートチャンネルのメッセージをリッスン), message.im (App Home とダイレクトメッセージのリスニング), and message.mpim (あなたのアプリが追加されているグループ DM のリスニング) +Request URL が検証されたら、**Subscribe to Bot Events** までスクロールします。メッセージに関するイベントが4つあります: +- `message.channels` あなたのアプリが追加されているパブリックチャンネルのメッセージをリッスン +- `message.groups` あなたのアプリが追加されているプライベートチャンネルのメッセージをリッスン +- `message.im` App Home とダイレクトメッセージのリスニング +- `message.mpim` あなたのアプリが追加されているグループ DM のリスニング もしボットに参加しているすべての場所で全てのメッセージイベントをリッスンさせたいなら、これら4つ全てのイベントを選んでください。選択したら、緑の **Save Changes** ボタンをクリックします。 @@ -195,7 +196,7 @@ app.message('hello', async ({ message, say }) => { ボタン、選択メニュー、日付ピッカー、ダイアログなどの機能を使用するには、インタラクティブ性を有効にする必要があります。イベントと同様に、Slack の URL を指定してアクション ( 「ボタン・クリック」など) を送信する必要があります。 -アプリ設定ページに戻り、左側の **Interactive Components** をクリックします。**Request URL** ボックスがもう 1 つあることがわかります。 +アプリ設定ページに戻り、左側の **Interactivity & Shortcuts** をクリックします。**Request URL** ボックスがもう 1 つあることがわかります。 デフォルトでは、Bolt はイベントに使用しているのと同じエンドポイントをインタラクティブコンポーネントに使用するように設定されているため、上記と同じリクエスト URL (この例では `https://8e8ec2d7.ngrok.io/slack/events`) を使用します。右下隅にある **Save Changes** ボタンを押してください。これでアプリのインタラクティブなコンポーネントの設定が有効になりました! @@ -314,10 +315,10 @@ app.action('button_click', async ({ body, ack, say }) => { 基本的なアプリの作成ができましたので、次回は是非もっといろいろな、 Bolt の機能を使ってアプリを作ってみましょう。下記のリンクを辿っていろいろアイデアを模索してみてください! -* [基本的な概念](https://slack.dev/bolt#basic)をお読みください。Bolt アプリからアクセスできるさまざまなメソッドと機能について学ぶことができます。 +* [基本的な概念](/bolt-js/ja-jp/concepts#basic)をお読みください。Bolt アプリからアクセスできるさまざまなメソッドと機能について学ぶことができます。 -* ボットが[`events()` メソッド](https://slack.dev/bolt#event-listening)でリッスンできるさまざまなイベントを確認しましょう。イベントはすべて[API サイト](https://api.slack.com/events)にリストされています。 +* ボットが[`events()` メソッド](/bolt-js/ja-jp/concepts#event-listening)でリッスンできるさまざまなイベントを確認しましょう。イベントはすべて[API サイト](https://api.slack.com/events)にリストされています。 -* Bolt を使用すると、アプリにアタッチされているクライアントで [Web API メソッドを呼び出す](https://slack.dev/bolt#web-api)ことができます。API サイトに [130 を超えるメソッド](https://api.slack.com/methods)を用意してあります。 +* Bolt を使用すると、アプリにアタッチされているクライアントで [Web API メソッドを呼び出す](/bolt-js/ja-jp/concepts#web-api)ことができます。API サイトに [220 を超えるメソッド](https://api.slack.com/methods)を用意してあります。 * [API サイト](https://api.slack.com/docs/token-types)ではさまざまなトークンタイプの詳細を確認することができます。アプリには、実行するアクションに応じて異なるトークンが必要になる場合があります。