Skip to content

Commit 171175c

Browse files
committed
Fix minor errors in documents
1 parent ef3f2fd commit 171175c

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

docs/_advanced/adapters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Adapters are responsible for handling and parsing incoming events from Slack to
1010

1111
By default, Bolt will use the built-in <a href="https://docs.python.org/3/library/http.server.html">`HTTPSever`</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 initalize 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 events.
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
@@ -22,8 +22,8 @@ For a more custom solution, you can set the `authorize` parameter to a function
2222
```python
2323
import os
2424
from slack_bolt import App
25-
# Import the AuthorizationResult class
26-
from slack_bolt.authorization import AuthorizationResult
25+
# Import the AuthorizeResult class
26+
from slack_bolt.authorization import AuthorizeResult
2727

2828
# This is just an example (assumes there are no user tokens)
2929
# You should store authorizations in a secure DB
@@ -46,7 +46,7 @@ installations = [
4646

4747
def authorize(enterprise_id, team_id, logger):
4848
# You can implement your own logic to fetch token here
49-
for (team in installations):
49+
for team in installations:
5050
# enterprise_id doesn't exist for some teams
5151
is_valid_enterprise = True if (("enterprise_id" not in team) or (enterprise_id == team["enterprise_id"])) else False
5252
if ((is_valid_enterprise == True) and (team["team_id"] == team_id)):

docs/_advanced/custom_adapters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ order: 1
1818
| `body: str` | The raw request body | **Yes** |
1919
| `query: any` | The query string data | No |
2020
| `headers: Dict[str, Union[str, List[str]]]` | Request headers | No |
21-
| `context: Dict[str, str]` | Any context for the request | No |
21+
| `context: BoltContext` | Any context for the request | No |
2222

2323
`BoltRequest` will return [an instance of `BoltResponse`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/response/response.py) from the Bolt app.
2424

docs/_advanced/lazy_listener.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Typically you'd call `ack()` as the first step of your listener functions. Calli
1212

1313
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.
1414

15-
Rather than acting as a decorator, lazy listeners take two keyword args:
15+
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()`
1717
* `lazy: List[Callable]`: Responsible for handling any time-consuming processes related to the event. The lazy function does not have access to `ack()`.
1818
</div>

docs/_basic/authenticating_oauth.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ To learn more about the OAuth installation flow with Slack, [read the API docume
1919

2020
```python
2121
import os
22+
from slack_bolt import App
2223
from slack_bolt.oauth.oauth_settings import OAuthSettings
2324
from slack_sdk.oauth.installation_store import FileInstallationStore
2425
from slack_sdk.oauth.state_store import FileOAuthStateStore
@@ -55,7 +56,7 @@ You can override the default OAuth using `oauth_settings`, which can be passed i
5556

5657
```python
5758
from slack_bolt.oauth.callback_options import CallbackOptions, SuccessArgs, FailureArgs
58-
import slack_bolt.response.BoltResponse
59+
from slack_bolt.response import BoltResponse
5960

6061
def success(args: SuccessArgs) -> BoltResponse:
6162
assert args.request is not None
@@ -74,6 +75,12 @@ def failure(args: FailureArgs) -> BoltResponse:
7475

7576
callback_options = CallbackOptions(success=success, failure=failure)
7677

78+
import os
79+
from slack_bolt import App
80+
from slack_bolt.oauth.oauth_settings import OAuthSettings
81+
from slack_sdk.oauth.installation_store import FileInstallationStore
82+
from slack_sdk.oauth.state_store import FileOAuthStateStore
83+
7784
app = App(
7885
signing_secret=os.environ.get("SLACK_SIGNING_SECRET"),
7986
installation_store=FileInstallationStore(base_dir="./data"),

docs/_basic/listening_messages.md

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

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

10-
To listen to messages that [your app has access to receive](https://api.slack.com/messaging/retrieving#permissions), you can use the `message()` method which filters out events that arent of type `message`.
10+
To listen to messages that [your app has access to receive](https://api.slack.com/messaging/retrieving#permissions), you can use the `message()` method which filters out events that aren't of type `message`.
1111

1212
`message()` accepts an argument of type `str` or `re.Pattern` object that filters out any messages that don’t match the pattern.
1313

@@ -33,6 +33,8 @@ The `re.compile()` method can be used instead of a string for more granular matc
3333
</div>
3434

3535
```python
36+
import re
37+
3638
@app.message(re.compile("(hi|hello|hey)"))
3739
def say_hello_regex(say, context):
3840
# regular expression matches are inside of context.matches

0 commit comments

Comments
 (0)