Skip to content

Commit f75d630

Browse files
authored
doc: make events in the document clearer (#415)
1 parent befc3a1 commit f75d630

11 files changed

+22
-22
lines changed

docs/_advanced/adapters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ order: 0
66
---
77

88
<div class="section-content">
9-
Adapters are responsible for handling and parsing incoming events from Slack to conform to <a href="https://github.com/slackapi/bolt-python/blob/main/slack_bolt/request/request.py">`BoltRequest`</a>, then dispatching those events to your Bolt app.
9+
Adapters are responsible for handling and parsing incoming requests from Slack to conform to <a href="https://github.com/slackapi/bolt-python/blob/main/slack_bolt/request/request.py">`BoltRequest`</a>, then dispatching those requests to your Bolt app.
1010

1111
By default, Bolt will use the built-in <a href="https://docs.python.org/3/library/http.server.html">`HTTPServer`</a> adapter. While this is okay for local development, <b>it is not recommended for production</b>. Bolt for Python includes a collection of built-in adapters that can be imported and used with your app. The built-in adapters support a variety of popular Python frameworks including Flask, Django, and Starlette among others. Adapters support the use of any production-ready web server of your choice.
1212

13-
To use an adapter, you'll create an app with the framework of your choosing and import its corresponding adapter. Then you'll initialize the adapter instance and call its function that handles and parses incoming events.
13+
To use an adapter, you'll create an app with the framework of your choosing and import its corresponding adapter. Then you'll initialize the adapter instance and call its function that handles and parses incoming requests.
1414

1515
The full list adapters, as well as configuration and sample usage, can be found within the repository's <a href="https://github.com/slackapi/bolt-python/tree/main/examples">`examples` folder</a>.
1616
</div>

docs/_advanced/authorization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ order: 5
66
---
77

88
<div class="section-content">
9-
Authorization is the process of determining which Slack credentials should be available while processing an incoming Slack event.
9+
Authorization is the process of determining which Slack credentials should be available while processing an incoming Slack request.
1010

1111
Apps installed on a single workspace can simply pass their bot token into the `App` constructor using the `token` parameter. However, if your app will be installed on multiple workspaces, you have two options. The easier option is to use the built-in OAuth support. This will handle setting up OAuth routes and verifying state. Read the section on [authenticating with OAuth](#authenticating-oauth) for details.
1212

13-
For a more custom solution, you can set the `authorize` parameter to a function upon `App` instantiation. The `authorize` function should return [an instance of `AuthorizeResult`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/authorization/authorize_result.py), which contains information about who and where the event is coming from.
13+
For a more custom solution, you can set the `authorize` parameter to a function upon `App` instantiation. The `authorize` function should return [an instance of `AuthorizeResult`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/authorization/authorize_result.py), which contains information about who and where the request is coming from.
1414

1515
`AuthorizeResult` should have a few specific properties, all of type `str`:
1616
- Either **`bot_token`** (xoxb) *or* **`user_token`** (xoxp) are **required**. Most apps will use `bot_token` by default. Passing a token allows built-in functions (like `say()`) to work.
1717
- **`bot_user_id`** and **`bot_id`**, if using a `bot_token`.
18-
- **`enterprise_id`** and **`team_id`**, which can be found in events sent to your app.
18+
- **`enterprise_id`** and **`team_id`**, which can be found in requests sent to your app.
1919
- **`user_id`** only when using `user_token`.
2020
</div>
2121

docs/_advanced/context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 9
66
---
77

88
<div class="section-content">
9-
All listeners have access to a `context` dictionary, which can be used to enrich events with additional information. Bolt automatically attaches information that is included in the incoming event, like `user_id`, `team_id`, `channel_id`, and `enterprise_id`.
9+
All listeners have access to a `context` dictionary, which can be used to enrich requests with additional information. Bolt automatically attaches information that is included in the incoming request, like `user_id`, `team_id`, `channel_id`, and `enterprise_id`.
1010

1111
`context` is just a dictionary, so you can directly modify it.
1212
</div>

docs/_advanced/global_middleware.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 8
66
---
77

88
<div class="section-content">
9-
Global middleware is run for all incoming events, before any listener middleware. You can add any number of global middleware to your app by passing middleware functions to `app.use()`. Middleware functions are called with the same arguments as listeners, with an additional `next()` function.
9+
Global middleware is run for all incoming requests, before any listener middleware. You can add any number of global middleware to your app by passing middleware functions to `app.use()`. Middleware functions are called with the same arguments as listeners, with an additional `next()` function.
1010

1111
Both global and listener middleware must call `next()` to pass control of the execution chain to the next middleware.
1212
</div>

docs/_advanced/lazy_listener.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ order: 10
88
<div class="section-content">
99
⚠️ Lazy listener functions are a beta feature to make it easier to deploy Bolt for Python apps to FaaS environments. As the feature is developed, Bolt for Python's API is subject to change.
1010

11-
Typically you'd call `ack()` as the first step of your listener functions. Calling `ack()` tells Slack that you've received the event and are handling it in within reasonable amount of time (3 seconds).
11+
Typically you'd call `ack()` as the first step of your listener functions. Calling `ack()` tells Slack that you've received the request and are handling it in within reasonable amount of time (3 seconds).
1212

13-
However, apps running on FaaS or similar runtimes that don't allow you to run threads or processes after returning an HTTP response cannot follow this pattern. Instead, you should set the `process_before_response` flag to `True`. This allows you to create a listener that calls `ack()` and handles the event safely, though you still need to complete everything within 3 seconds. For events, while a listener doesn't need `ack()` method call as you normally would, the listener needs to complete within 3 seconds, too.
13+
However, apps running on FaaS or similar runtimes that don't allow you to run threads or processes after returning an HTTP response cannot follow this pattern. Instead, you should set the `process_before_response` flag to `True`. This allows you to create a listener that calls `ack()` and handles the request safely, though you still need to complete everything within 3 seconds. For events, while a listener doesn't need `ack()` method call as you normally would, the listener needs to complete within 3 seconds, too.
1414

1515
Lazy listeners can be a solution for this issue. Rather than acting as a decorator, lazy listeners take two keyword args:
1616
* `ack: Callable`: Responsible for calling `ack()`
17-
* `lazy: List[Callable]`: Responsible for handling any time-consuming processes related to the event. The lazy function does not have access to `ack()`.
17+
* `lazy: List[Callable]`: Responsible for handling any time-consuming processes related to the request. The lazy function does not have access to `ack()`.
1818
</div>
1919

2020
```python

docs/_basic/acknowledging_events.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
title: Acknowledging events
2+
title: Acknowledging requests
33
lang: en
44
slug: acknowledge
55
order: 7
66
---
77

88
<div class="section-content">
99

10-
Actions, commands, and options events must **always** be acknowledged using the `ack()` function. This lets Slack know that the event was received and updates the Slack user interface accordingly.
10+
Actions, commands, and options requests must **always** be acknowledged using the `ack()` function. This lets Slack know that the request was received and updates the Slack user interface accordingly.
1111

12-
Depending on the type of event, your acknowledgement may be different. For example, when acknowledging a menu selection associated with an external data source, you would call `ack()` with a list of relevant [options](https://api.slack.com/reference/block-kit/composition-objects#option).
12+
Depending on the type of request, your acknowledgement may be different. For example, when acknowledging a menu selection associated with an external data source, you would call `ack()` with a list of relevant [options](https://api.slack.com/reference/block-kit/composition-objects#option).
1313

1414
We recommend calling `ack()` right away before sending a new message or fetching information from your database since you only have 3 seconds to respond.
1515

docs/_basic/listening_actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Your app can listen to user actions, like button clicks, and menu selects, using
1010

1111
Actions can be filtered on an `action_id` of type `str` or `re.Pattern`. `action_id`s act as unique identifiers for interactive components on the Slack platform.
1212

13-
You'll notice in all `action()` examples, `ack()` is used. It is required to call the `ack()` function within an action listener to acknowledge that the event was received from Slack. This is discussed in the [acknowledging events section](#acknowledge).
13+
You'll notice in all `action()` examples, `ack()` is used. It is required to call the `ack()` function within an action listener to acknowledge that the request was received from Slack. This is discussed in the [acknowledging requests section](#acknowledge).
1414

1515
</div>
1616

docs/_basic/listening_modals.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ order: 12
77

88
<div class="section-content">
99

10-
If a <a href="https://api.slack.com/reference/block-kit/views">view payload</a> contains any input blocks, you must listen to `view_submission` events to receive their values. To listen to `view_submission` events, you can use the built-in `view()` method. `view()` requires a `callback_id` of type `str` or `re.Pattern`.
10+
If a <a href="https://api.slack.com/reference/block-kit/views">view payload</a> contains any input blocks, you must listen to `view_submission` requests to receive their values. To listen to `view_submission` requests, you can use the built-in `view()` method. `view()` requires a `callback_id` of type `str` or `re.Pattern`.
1111

1212
You can access the value of the `input` blocks by accessing the `state` object. `state` contains a `values` object that uses the `block_id` and unique `action_id` to store the input values.
1313

@@ -18,7 +18,7 @@ Read more about view submissions in our <a href="https://api.slack.com/surfaces/
1818
<div>
1919
<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>
2020
```python
21-
# Handle a view_submission event
21+
# Handle a view_submission request
2222
@app.view("view_1")
2323
def handle_submission(ack, body, client, view, logger):
2424
# Assume there's an input block with `block_c` as the block_id and `dreamy_input`
@@ -31,7 +31,7 @@ def handle_submission(ack, body, client, view, logger):
3131
if len(errors) > 0:
3232
ack(response_action="errors", errors=errors)
3333
return
34-
# Acknowledge the view_submission event and close the modal
34+
# Acknowledge the view_submission request and close the modal
3535
ack()
3636
# Do whatever you want with the input data - here we're saving it to a DB
3737
# then sending the user a verification of their submission

docs/_basic/listening_responding_commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ order: 9
77

88
<div class="section-content">
99

10-
Your app can use the `command()` method to listen to incoming slash command events. The method requires a `command_name` of type `str`.
10+
Your app can use the `command()` method to listen to incoming slash command requests. The method requires a `command_name` of type `str`.
1111

12-
Commands must be acknowledged with `ack()` to inform Slack your app has received the event.
12+
Commands must be acknowledged with `ack()` to inform Slack your app has received the request.
1313

1414
There are two ways to respond to slash commands. The first way is to use `say()`, which accepts a string or JSON payload. The second is `respond()` which is a utility for the `response_url`. These are explained in more depth in the [responding to actions](#action-respond) section.
1515

docs/_basic/listening_responding_shortcuts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ order: 8
99

1010
The `shortcut()` method supports both [global shortcuts](https://api.slack.com/interactivity/shortcuts/using#global_shortcuts) and [message shortcuts](https://api.slack.com/interactivity/shortcuts/using#message_shortcuts).
1111

12-
Shortcuts are invokable entry points to apps. Global shortcuts are available from within search and text composer area in Slack. Message shortcuts are available in the context menus of messages. Your app can use the `shortcut()` method to listen to incoming shortcut events. The method requires a `callback_id` parameter of type `str` or `re.Pattern`.
12+
Shortcuts are invokable entry points to apps. Global shortcuts are available from within search and text composer area in Slack. Message shortcuts are available in the context menus of messages. Your app can use the `shortcut()` method to listen to incoming shortcut requests. The method requires a `callback_id` parameter of type `str` or `re.Pattern`.
1313

14-
Shortcuts must be acknowledged with `ack()` to inform Slack that your app has received the event.
14+
Shortcuts must be acknowledged with `ack()` to inform Slack that your app has received the request.
1515

1616
Shortcuts include a `trigger_id` which an app can use to [open a modal](#creating-modals) that confirms the action the user is taking.
1717

0 commit comments

Comments
 (0)