Skip to content
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

Fix broken markdown tables in reference docs #1056

Merged
merged 1 commit into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/_tutorials/ja_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Slack アプリは通常、Slack からのイベント情報を受け取った
以下の表は、現在提供しているリスナー関数を渡すためのメソッドの一覧です。これらのメソッドを使って、Slack から送信された各種のイベントを処理します。各メソッドの一般的な設定は、まずイベントを判別するためのパラメーターがあり、リスナー関数がそれに続く形になっています。イベント判定のためのパラメーターとは、以下の説明にある、特定の `callback_id` やメッセージ中の部分一致の文字列を指定する部分などのことです。これにより、リスナー関数が処理するイベントを条件に合致するものだけに絞り込むことができます。

| メソッド | 説明 |
|--------------------------------------------------------------------|
| :---: | :--- |
| `app.event(eventType, fn);` | Events API のイベントをリッスンします。`eventType` は、処理対象の[イベント](https://api.slack.com/events)を指定するための文字列 です。この値は、Slackアプリの設定画面でサブスクライブの設定がされている必要があります。 |
| `app.message([pattern ,] fn);` | [`message` イベント](https://api.slack.com/events/message)のリッスンに特化した、便利なメソッドです。`pattern` パラメーターには、部分一致させる文字列、または正規表現を指定します。これによって処理対象のメッセージを判別します。 |
| `app.action(actionId, fn);` | Block Kit エレメントから送信される `action` イベントをリッスンします。このイベントにはユーザーのボタン操作、メニュー選択、日付ピッカーの操作などがあります。`actionId` は文字列型で、アプリがビュー内に含めたブロックエレメントに指定した一意の `action_id` の値と一致する必要があります。ここでいう「ビュー」とは、メッセージ、モーダル、アプリのホームタブのことを指します。アクションエレメントを `input` ブロックに配置した場合はイベントがトリガーされないことに注意してください。
Expand All @@ -46,7 +46,7 @@ Slack アプリは通常、Slack からのイベント情報を受け取った
一部のメソッドでは、さまざまな制約オブジェクトを指定することができます。制約オブジェクトを使用すると、リスナー関数で扱うイベントをさらに絞り込んだり、特定のケースに対応することができます。制約オブジェクトは、上で説明した識別子の代わりとしてメソッドに渡すことができます。さまざまな制約オブジェクトとそれを渡せるメソッドを以下の表にまとめます。

| メソッド | オプション | 詳細 |
|--------------------------------------------------------------------|
| :---: | :--- | :--- |
| `app.action(constraints, fn)` | `block_id`, `action_id`, `callback_id`, (,`type`) | `action_id` だけでなく、他の制約指定でもリッスンします。`block_id` は、エレメントの親ブロックの ID です。`callback_id` は、ビューの初期化時に指定したビューの ID です(モーダルに配置したアクションエレメントのみで使用できます)。`type` を指定することで、blocks内のアクションのみを処理するか、あるいは `attachments` 内のアクションのみなのかを選択できます。type に `block_actions` を指定すると、blocks内のアクションエレメントのみを処理します。`interactive_message` を指定すると、旧来の `attachments` 内のインタラクティブなアクションのみを処理します。 |
| `app.shortcut(constraints, fn)` | `type`, `callback_id` | 対象のショートカットの種類を指定できます。`type` に `shortcut`を指定すると**グローバルショートカット**、 `message_action`の場合は**メッセージショートカット**)となります。`callbackId` には文字列か正規表現を指定します。 |
| `app.view(constraints, fn)` | `type`, `callback_id` | `type` には `view_closed` または `view_submission` のいずれかを指定します。ここで指定した種別のイベントの場合のみリスナー関数にイベントが渡されます。`callback_id` は、アプリでモーダルを開く際に設定したビューの `callback_id` です。 |
Expand Down Expand Up @@ -124,7 +124,7 @@ App オプションは、`App` のコンストラクターに渡します。
Bolt では、さまざまなエラーが定義されています。これらにはより具体的なコンテキスト情報が含まるため、エラーのハンドリングが行いやすくなるでしょう。以下は、すべてのエラーコードを網羅しているわけではありませんが、開発中に目にすると思われるものを取り上げたエラーコードの一覧です。

| エラーコード | 詳細 |
|--------------------------------------------------------------------|
| :---: | :--- |
| `AppInitializationError` | 無効な初期化オプションが渡されたことを示します。原因として、署名シークレットが渡されていないことや、競合するオプションが指定されたことなどが考えられます(例 : `token` と `authorize` の両方を同時に指定することはできない)。`original` プロパティで詳細を確認できます。このエラーがスローされるのは、アプリのコンストラクターで行われる初期化時のみです。 |
| `AuthorizationError` | インストール情報が取得できなかった、またはパースできなかったときにのみスローされるエラーです。このエラーは、ビルトインの OAuth サポートを使用しているときに発生する可能性があります。また、独自の `authorize` 関数を作成するときに、このエラーをインポートして使用することができます。 |
| `ContextMissingPropertyError` | `context` オブジェクトに必要な情報が不足しているときにスローされるエラーです(例 : `ignoreSelf` を `true` に設定したのに `botUserId` または `botId` が含まれていない)。不足しているプロパティは、`missingProperty` プロパティで確認できます。 |
Expand All @@ -140,7 +140,7 @@ Bolt では、さまざまなエラーが定義されています。これらに
Bolt では、Slack API の呼び出しのため `WebClient` をインポートしています。クライアントで API 呼び出しを行う際に目にすると思われるエラーを以下に示します。より詳しい内容は、[Web API のドキュメント](/node-slack-sdk/web-api#handle-errors)を参照してください。クライアントのエラーをハンドリングする際、`data` プロパティの `body` で詳しい情報を確認できます。

| エラーコード | 詳細 |
|--------------------------------------------------------------------|
| :---: | :--- |
| `PlatformError` | Slack API の呼び出し中に何らかの異常が発生したことを示すエラー。`data` プロパティを持ちます。 |
| `RequestError` | リクエストが送信できなかったことを示すエラー。ネットワーク接続が利用できないことなどが原因として考えられます。`original` プロパティで詳細を確認できます。 |
| `RateLimitedError` | 短時間で送信したリクエストが多すぎることを示すエラー。`retryAfter` プロパティで、再送信まで待機する必要のある秒数を確認できます。`WebClient` は、デフォルトでレート制限エラーのハンドリングを行います。[詳しくはドキュメントを参照してください](/node-slack-sdk/web-api#rate-limits)。 |
Expand Down
8 changes: 4 additions & 4 deletions docs/_tutorials/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Slack apps typically receive and/or respond to one to many incoming events from
Below is the current list of methods that accept listener functions. These methods handle specific event types coming from Slack, and typically include an identifing parameter before the listener function. The identifying parameter (included below) narrows the events to specific interactions that your listener function is intended to handle, such as a specific `callback_id`, or a certain substring within a message.

| Method | Description |
|--------------------------------------------------------------------|
| :---: | :--- |
| `app.event(eventType, fn);` | Listens for Events API events. The `eventType` is a `string` to identify a [specific event](https://api.slack.com/events) to handle (which must be subscribed to in your app's configuration). |
| `app.message([pattern ,] fn);` | Convenience method to listen specifically to the [`message` event](https://api.slack.com/events/message). The pattern parameter can be any substring (`string`) or `RegExp` expression, which will be used to identify the incoming message. |
| `app.action(actionId, fn);` | Listens for an action event from a Block Kit element, such as a user interaction with a button, select menu, or datepicker. The `actionId` identifier is a `string` that should match the unique `action_id` included when your app sends the element to a view. Note that a view can be a message, modal, or app home. Note that action elements included in an `input` block do not trigger any events.
Expand All @@ -46,7 +46,7 @@ Below is the current list of methods that accept listener functions. These metho
There are a collection of constraint objects that some methods have access to. These can be used to narrow the event your listener function handles, or to handle special cases. Constraint objects can be passed in lieu of the identifiers outlined above. Below is a collection of constraint objects and the methods they can be passed to.

| Method | Options | Details |
|--------------------------------------------------------------------|
| :---: | :--- | :--- |
| `app.action(constraints, fn)` | `block_id`, `action_id`, `callback_id`, (,`type`) | Listens for more than just the `action_id`. `block_id` is the ID for the element's parent block. `callback_id` is the ID of the view that is passed when instantiating it (only used when action elements are in modals). To specifically handle an action element in blocks or in legacy attachments, you can use `type` with the value of `block_actions` or `interactive_message` respectively. |
| `app.shortcut(constraints, fn)` | `type`, `callback_id` | Allows specification of the type of shortcut. `type` must either be `shortcut` for **global shortcuts** or `message_action` for **message_shortcuts**. `callbackId` can be a `string` or `RegExp`. |
| `app.view(constraints, fn)` | `type`, `callback_id` | `type` must either be `view_closed` or `view_submission`, which determines what specific event your listener function is sent. `callback_id` is the `callback_id` of the view that is sent when your app opens the modal. |
Expand Down Expand Up @@ -121,7 +121,7 @@ App options are passed into the `App` constructor.
Bolt includes a set of error types to make errors easier to handle, with more specific contextual information. Below is a non-exhaustive list of error codes you may run into during development:

| Error code | Details |
|--------------------------------------------------------------------|
| :---: | :--- |
| `AppInitializationError` | Invalid initialization options were passed. This could include not passing a signing secret, or passing in conflicting options (for example, you can't pass in both `token` and `authorize`). Includes an `original` property with more details. This error is only thrown during initialization (within the App's constructor). |
| `AuthorizationError` | Error exclusively thrown when installation information can't be fetched or parsed. You may encounter this error when using the built-in OAuth support, or you may want to import and use this error when building your own `authorize` function. |
| `ContextMissingPropertyError` | Error thrown when the `context` object is missing necessary information, such as not including `botUserId` or `botId` when `ignoreSelf` is set to `true`. The missing property is available in the `missingProperty` property. |
Expand All @@ -137,7 +137,7 @@ Bolt includes a set of error types to make errors easier to handle, with more sp
Bolt imports a `WebClient` to call Slack's APIs. Below is a set of errors you may encounter when making API calls with the client, though you can read more [in the web API documentation](/node-slack-sdk/web-api#handle-errors). When handling client errors, more information can be found in the body within the `data` property.

| Error code | Details |
|--------------------------------------------------------------------|
| :---: | :--- |
| `PlatformError` | Error received when calling a Slack API. Includes a `data` property. |
| `RequestError` | A request could not be sent, perhaps because your network connection is not available. It has an `original` property with more details. |
| `RateLimitedError` | Your app has made too many requests too quickly. Inclues a `retryAfter` property with the number of seconds you should wait before trying to send again. The `WebClient` will handle rate limit errors by default–[you can read more in the documentation](/node-slack-sdk/web-api#rate-limits). |
Expand Down