Skip to content

Commit bdba69a

Browse files
authored
Fix #358 Add more links to listener argument guide in document pages (#360)
1 parent 5c7399c commit bdba69a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+137
-11
lines changed

docs/_advanced/global_middleware.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Global middleware is run for all incoming events, before any listener middleware
1111
Both global and listener middleware must call `next()` to pass control of the execution chain to the next middleware.
1212
</div>
1313

14+
<div>
15+
<span class="annotation">Refer to <a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">the module document</a> to learn the available listener arguments.</span>
1416
```python
1517
@app.use
1618
def auth_acme(client, context, logger, payload, next):
@@ -32,3 +34,4 @@ def auth_acme(client, context, logger, payload, next):
3234
# Pass control to the next middleware
3335
next()
3436
```
37+
</div>

docs/_advanced/ja_global_middleware.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ order: 6
1111
グローバルミドルウェアでもリスナーミドルウェアでも、次のミドルウェアに実行チェーンの制御をリレーするために、`next()` を呼び出す必要があります。
1212
</div>
1313

14+
<div>
15+
<span class="annotation">指定可能な引数の一覧は<a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">モジュールドキュメント</a>を参考にしてください。</span>
1416
```python
1517
@app.use
1618
def auth_abc(client, context, logger, payload, next):
@@ -32,3 +34,4 @@ def auth_abc(client, context, logger, payload, next):
3234
# 次のミドルウェアに実行権を渡します
3335
next()
3436
```
37+
</div>

docs/_advanced/ja_listener_middleware.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ order: 5
99
リスナーミドルウェアは、それを渡したリスナーでのみ実行されるミドルウェアです。リスナーには、`middleware` パラメーターを使ってミドルウェア関数をいくつでも渡すことができます。このパラメーターには、1 つまたは複数のミドルウェア関数からなるリストを指定します。
1010
</div>
1111

12+
<div>
13+
<span class="annotation">指定可能な引数の一覧は<a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">モジュールドキュメント</a>を参考にしてください。</span>
1214
```python
1315
# "bot_message" サブタイプのメッセージを抽出するリスナーミドルウェア
1416
def no_bot_messages(message, next):
@@ -22,3 +24,4 @@ def log_message(logger, event):
2224
logger.info(f"(MSG) User: {event['user']}
2325
Message: {event['text']}")
2426
```
27+
</div>

docs/_advanced/listener_middleware.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ order: 5
99
Listener middleware is only run for the listener in which it's passed. You can pass any number of middleware functions to the listener using the `middleware` parameter, which must be a list that contains one to many middleware functions.
1010
</div>
1111

12+
<div>
13+
<span class="annotation">Refer to <a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">the module document</a> to learn the available listener arguments.</span>
1214
```python
1315
# Listener middleware which filters out messages with "bot_message" subtype
1416
def no_bot_messages(message, next):
@@ -21,3 +23,4 @@ def no_bot_messages(message, next):
2123
def log_message(logger, event):
2224
logger.info(f"(MSG) User: {event['user']}\nMessage: {event['text']}")
2325
```
26+
</div>

docs/_basic/acknowledging_events.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ We recommend calling `ack()` right away before sending a new message or fetching
1515

1616
</div>
1717

18+
<div>
19+
<span class="annotation">Refer to <a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">the module document</a> to learn the available listener arguments.</span>
1820
```python
1921
# Example of responding to an external_select options request
2022
@app.options("menu_selection")
@@ -31,3 +33,4 @@ def show_menu_options(ack):
3133
]
3234
ack(options=options)
3335
```
36+
</div>

docs/_basic/ja_acknowledging_events.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ order: 7
1515

1616
</div>
1717

18+
<div>
19+
<span class="annotation">指定可能な引数の一覧は<a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">モジュールドキュメント</a>を参考にしてください。</span>
1820
```python
1921
# 外部データを使用する選択メニューオプションに応答するサンプル
2022
@app.options("menu_selection")
@@ -31,3 +33,4 @@ def show_menu_options(ack):
3133
]
3234
ack(options=options)
3335
```
36+
</div>

docs/_basic/ja_listening_actions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ Bolt アプリは `action` メソッドを用いて、ボタンのクリック
1414

1515
</div>
1616

17+
<div>
18+
<span class="annotation">指定可能な引数の一覧は<a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">モジュールドキュメント</a>を参考にしてください。</span>
1719
```python
1820
# 'approve_button' という action_id のブロックエレメントがトリガーされるたびに、このリスナーが呼び出させれる
1921
@app.action("approve_button")
2022
def update_message(ack):
2123
ack()
2224
# アクションへの反応としてメッセージを更新
2325
```
26+
</div>
2427

2528
<details class="secondary-wrapper">
2629
<summary class="section-head" markdown="0">

docs/_basic/ja_listening_events.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ order: 3
1313

1414
</div>
1515

16+
<div>
17+
<span class="annotation">指定可能な引数の一覧は<a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">モジュールドキュメント</a>を参考にしてください。</span>
1618
```python
1719
# ユーザーがワークスペースに参加した際に、自己紹介を促すメッセージを指定のチャンネルに送信
1820
@app.event("team_join")
@@ -22,6 +24,7 @@ def ask_for_introduction(event, say):
2224
text = f"Welcome to the team, <@{user_id}>! 🎉 You can introduce yourself in this channel."
2325
say(text=text, channel=welcome_channel_id)
2426
```
27+
</div>
2528

2629
<details class="secondary-wrapper" >
2730

docs/_basic/ja_listening_messages.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ order: 1
1010
[あなたのアプリがアクセス権限を持つ](https://api.slack.com/messaging/retrieving#permissions)メッセージの投稿イベントをリッスンするには `message()` メソッドを利用します。このメソッドは `type``message` ではないイベントを処理対象から除外します。
1111

1212
`message()` の引数には `str` 型または `re.Pattern` オブジェクトを指定できます。この条件のパターンに一致しないメッセージは除外されます。
13-
1413
</div>
1514

15+
<div>
16+
<span class="annotation">指定可能な引数の一覧は<a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">モジュールドキュメント</a>を参考にしてください。</span>
1617
```python
1718
# '👋' が含まれるすべてのメッセージに一致
1819
@app.message(":wave:")
1920
def say_hello(message, say):
2021
user = message['user']
2122
say(f"Hi there, <@{user}>!")
2223
```
24+
</div>
2325

2426
<details class="secondary-wrapper">
2527
<summary markdown="0">

docs/_basic/ja_listening_modals.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ order: 12
1515

1616
</div>
1717

18+
<div>
19+
<span class="annotation">指定可能な引数の一覧は<a href="https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html" target="_blank">モジュールドキュメント</a>を参考にしてください。</span>
1820
```python
1921
# view_submission イベントを処理
2022
@app.view("view_1")
@@ -46,3 +48,4 @@ def handle_submission(ack, body, client, view):
4648
# ユーザーにメッセージを送信
4749
client.chat_postMessage(channel=user, text=msg)
4850
```
51+
</div>

0 commit comments

Comments
 (0)