Skip to content

Commit

Permalink
Update respond argument docs to include views listener (#1313)
Browse files Browse the repository at this point in the history
* Update respond arg docs to include views

* Update Japanese docs missed with previous commit

* Additional clarification when respond is used with views

* Update docs/_tutorials/ja_reference.md with latest translation

Co-authored-by: Kazuhiro Sera <[email protected]>

* Fix URLs for channel select

Co-authored-by: Kazuhiro Sera <[email protected]>
  • Loading branch information
amarinelli and seratch authored Feb 12, 2022
1 parent 9782020 commit bbb2553
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Most of the app's functionality will be inside listener functions (the `fn` para
| `say` | Function to send a message to the channel associated with the incoming event. This argument is only available when the listener is triggered for events that contain a `channel_id` (the most common being `message` events). `say` accepts simple strings (for plain-text messages) and objects (for messages containing blocks). `say` returns a promise that will resolve with a [`chat.postMessage` response](https://api.slack.com/methods/chat.postMessage).
| `ack` | Function that **must** be called to acknowledge that an incoming event was received by your app. `ack` exists for all actions, shortcuts, view, slash command and options requests. `ack` returns a promise that resolves when complete. Read more in [Acknowledging events](#acknowledging-events)
| `client` | Web API client that uses the token associated with that event. For single-workspace installations, the token is provided to the constructor. For multi-workspace installations, the token is returned by the `authorize` function.
| `respond` | Function that responds to an incoming event **if** it contains a `response_url` (shortcuts, actions, and slash commands). `respond` returns a promise that resolves with the results of responding using the `response_url`.
| `respond` | Function that responds to an incoming event **if** it contains a `response_url` (actions, shortcuts, view submissions, and slash commands). `respond` returns a promise that resolves with the results of responding using the `response_url`.
| `context` | Event context. This object contains data about the event and the app, such as the `botId`. Middleware can add additional context before the event is passed to listeners.
| `body` | Object that contains the entire body of the request (superset of `payload`). Some accessory data is only available outside of the payload (such as `trigger_id` and `authorizations`).

Expand Down
2 changes: 1 addition & 1 deletion docs/_tutorials/ja_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Slack アプリは通常、Slack からのイベント情報を受け取った
| `say` | `message`, `event`, `action`, `command` | 受信したイベントが紐づいているチャンネルにメッセージを送信する関数。この引数が使用できるのは、リスナーをトリガーしたイベントにチャンネル ID が含まれる場合のみです(`message` イベントが最も一般的です)。`say` は、シンプルな文字列(プレーンテキストのメッセージ)またはオブジェクト(ブロックを含むメッセージ)を受け付けます。`say` は Promise を返します。この Promise は [`chat.postMessage` の応答でresolveされます](https://api.slack.com/methods/chat.postMessage)。もし`action` メソッドや、`message` 以外のイベントを使用する場合は、[イベントの payload にチャンネル ID が含まれているかを確認するようにしてください](https://api.slack.com/events)
| `ack` | `action`, `shortcut`, `view`, `command`, `options` | アプリが受信イベントを受け取ったことを確認するために呼び出す**必要のある関数**`ack` は応答の完了時にresolveする Promise を返します。詳しくは、[イベントの確認](#acknowledging-events)を参照してください。
| `client` | すべてのリスナー | イベントに関連づけられたトークンを使用する Web API クライアント。単一のワークスペースへのインストールでは、トークンは Appのコンストラクターに提供されます。複数のワークスペースへのインストールでは、トークンは `authorize` 関数から返されます。
| `respond` | `shortcut`, `action`, `command` | 受信イベントに `response_url`**含まれる場合**に、受信イベントに応答を返す関数。`respond` は Promise を返します。この Promise は、`response_url` の応答結果に resolveされます。ショートカットに関しては、`respond` はメッセージショートカットで**のみ**動作します(グローバルショートカットでは動作しません)。
| `respond` | `action`, `shortcut`, `view`, `command` | 受信イベントに `response_url`**含まれる場合**に、受信イベントに応答を返す関数。`respond` は Promise を返します。この Promise は、`response_url` の応答結果に resolveされます。ショートカットに関しては、`respond` はメッセージショートカットで**のみ**動作します(グローバルショートカットでは動作しません)。ビューでの `respond` は モーダル内の input ブロックの [conversations list](https://api.slack.com/reference/block-kit/block-elements#conversation_select)[channels list](https://api.slack.com/reference/block-kit/block-elements#channel_select) のセレクトメニューで `response_url_enabled: true` というオプションが指定されている場合**のみ**動作します
| `context` | すべてのリスナー | イベントのコンテキスト。このオブジェクトは、`botId` など、イベントやアプリに関するデータを保持します。イベントがリスナーに渡される前に、ミドルウェアで他のコンテキスト情報を追加することもできます。
| `body` | すべてのリスナー | リクエストの `body` 全体を保持するオブジェクト(`payload` のスーパーセット)。`trigger_id``authorizations` など、一部の付帯的なデータは payload の外側でのみ利用できます。

Expand Down
2 changes: 1 addition & 1 deletion docs/_tutorials/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Listener functions have access to a set of arguments that may change based on th
| `say` | `message`, `event`, `action` `command` | Function to send a message to the channel associated with the incoming event. This argument is only available when the listener is triggered for events that contain a channel ID (the most common being `message` events). `say` accepts simple strings (for plain-text messages) and objects (for messages containing blocks). `say` returns a promise that will resolve with a [`chat.postMessage` response](https://api.slack.com/methods/chat.postMessage). If you're using an the `action` method, or an event other than `message`, you should [ensure that the event payload contains a channel ID](https://api.slack.com/events).
| `ack` | `action`, `shortcut`, `view`, `command`, `options` | Function that **must** be called to acknowledge that an incoming event was received by your app. `ack` returns a promise that resolves when complete. Read more in [Acknowledging events](#acknowledging-events)
| `client` | All listeners | Web API client that uses the token associated with that event. For single-workspace installations, the token is provided to the constructor. For multi-workspace installations, the token is returned by the `authorize` function.
| `respond` | `shortcut`, `action`, `command` | Function that responds to an incoming event **if** it contains a `response_url`. `respond` returns a promise that resolves with the results of responding using the `response_url`. For shortcuts, `respond` will **only** work for message shortcuts (not global shortcuts).
| `respond` | `action`, `shortcut`, `view`, `command` | Function that responds to an incoming event **if** it contains a `response_url`. `respond` returns a promise that resolves with the results of responding using the `response_url`. For shortcuts, `respond` will **only** work for message shortcuts (not global shortcuts). For views, `respond` will **only** work when using `response_url_enabled: true` for [conversations list](https://api.slack.com/reference/block-kit/block-elements#conversation_select) and [channels list](https://api.slack.com/reference/block-kit/block-elements#channel_select) select menus in input blocks in modals.
| `context` | All listeners | Event context. This object contains data about the event and the app, such as the `botId`. Middleware can add additional context before the event is passed to listeners.
| `body` | All listeners | Object that contains the entire body of the request (superset of `payload`). Some accessory data is only available outside of the payload (such as `trigger_id` and `authorizations`).

Expand Down

0 comments on commit bbb2553

Please sign in to comment.