-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update respond
argument docs to include views
listener
#1313
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1313 +/- ##
=======================================
Coverage 73.24% 73.24%
=======================================
Files 17 17
Lines 1439 1439
Branches 431 431
=======================================
Hits 1054 1054
Misses 300 300
Partials 85 85 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Can you update https://github.com/slackapi/bolt-js/blob/main/docs/_tutorials/ja_reference.md as well? I've left a comment on how to do so.
docs/_tutorials/reference.md
Outdated
@@ -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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the Japanese one with the following as well? https://github.com/slackapi/bolt-js/blob/main/docs/_tutorials/ja_reference.md
| `respond` | `action`, `shortcut`, `view`, `command` | 受信イベントに `response_url` が**含まれる場合**に、受信イベントに応答を返す関数。`respond` は Promise を返します。この Promise は、`response_url` の応答結果に resolveされます。ショートカットに関しては、`respond` はメッセージショートカットで**のみ**動作します(グローバルショートカットでは動作しません)。
docs/_tutorials/reference.md
Outdated
@@ -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#conversation_select) select menus in input blocks in modals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seratch, I have added an additional note and hoping you can help with the JP translation again. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amarinelli Can you check this?
Co-authored-by: Kazuhiro Sera <[email protected]>
Summary
Small update of
respond
docs to fix #1312.Requirements