Skip to content

Commit e8222b5

Browse files
lukegalbraithrussellClaude
andauthored
docs: fix critical inaccuracies in English documentation (#1512)
Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
1 parent df29f83 commit e8222b5

9 files changed

Lines changed: 26 additions & 44 deletions

File tree

docs/english/concepts/adding-agent-features.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def handle_message(
190190
# Add eyes reaction only to the first message (DMs only — channel
191191
# threads already have the reaction from the initial app_mention)
192192
if is_dm and not existing_session_id:
193-
await client.reactions_add(
193+
client.reactions_add(
194194
channel=channel_id,
195195
timestamp=event["ts"],
196196
name="eyes",
@@ -274,7 +274,7 @@ The `say_stream` utility streamlines calling the Python Slack SDK's [`WebClient.
274274
| `recipient_team_id` | Sourced from the event `team_id` (`enterprise_id` if the app is installed on an org).
275275
| `recipient_user_id` | Sourced from the `user_id` of the event.
276276

277-
If neither a `channel_id` or `thread_ts` can be sourced, then the utility will be `None`.
277+
If either `channel_id` or `thread_ts` cannot be sourced, the utility will be `None`.
278278

279279
```python
280280
streamer = say_stream()
@@ -571,7 +571,7 @@ def handle_app_mentioned(
571571

572572
except Exception as e:
573573
logger.exception(f"Failed to handle app mention: {e}")
574-
await say(
574+
say(
575575
text=f":warning: Something went wrong! ({e})",
576576
thread_ts=event.get("thread_ts") or event["ts"],
577577
)

docs/english/concepts/message-sending.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The `say_stream` utility streamlines calling the Python Slack SDK's [`WebClient.
5454
| `recipient_team_id` | Sourced from the event `team_id` (`enterprise_id` if the app is installed on an org).
5555
| `recipient_user_id` | Sourced from the `user_id` of the event.
5656

57-
If neither a `channel_id` or `thread_ts` can be sourced, then the utility will be `None`.
57+
If either `channel_id` or `thread_ts` cannot be sourced, the utility will be `None`.
5858

5959
For information on calling the `chat_*Stream` API methods directly, see the [_Sending streaming messages_](/tools/python-slack-sdk/web#sending-streaming-messages) section of the Python Slack SDK docs.
6060

@@ -79,7 +79,7 @@ def handle_app_mention(client: WebClient, say_stream: SayStream):
7979
def handle_message(client: WebClient, say_stream: SayStream):
8080
stream = say_stream()
8181

82-
stream.append(markdown_text="Let me consult my *vast knowledge database*...)
82+
stream.append(markdown_text="Let me consult my *vast knowledge database*...")
8383
stream.stop()
8484

8585
if __name__ == "__main__":

docs/english/concepts/updating-pushing-views.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Updating & pushing views
22

3-
Modals contain a stack of views. When you call [`views_open`](https://api./reference/methods/views.open/slack.com/methods/views.open), you add the root view to the modal. After the initial call, you can dynamically update a view by calling [`views_update`](/reference/methods/views.update/), or stack a new view on top of the root view by calling [`views_push`](/reference/methods/views.push/)
3+
Modals contain a stack of views. When you call [`views_open`](/reference/methods/views.open/), you add the root view to the modal. After the initial call, you can dynamically update a view by calling [`views_update`](/reference/methods/views.update/), or stack a new view on top of the root view by calling [`views_push`](/reference/methods/views.push/)
44

55
## The `views_update` method
66

docs/english/concepts/using-the-assistant-class.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ You _could_ go it alone and [listen](/tools/bolt-python/concepts/event-listening
5151

5252
While the `assistant_thread_started` and `assistant_thread_context_changed` events do provide Slack-client thread context information, the `message.im` event does not. Any subsequent user message events won't contain thread context data. For that reason, Bolt not only provides a way to store thread context — the `threadContextStore` property — but it also provides a `DefaultThreadContextStore` instance that is utilized by default. This implementation relies on storing and retrieving [message metadata](/messaging/message-metadata/) as the user interacts with the app.
5353

54-
If you do provide your own `threadContextStore` property, it must feature `get` and `save` methods.
54+
If you do provide your own `threadContextStore` property, it must feature `find` and `save` methods.
5555

5656
:::tip[Refer to the [reference docs](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.]
5757
:::
@@ -138,10 +138,10 @@ Messages sent to the app do not contain a [subtype](/reference/events/message#su
138138

139139
There are three utilities that are particularly useful in curating the user experience:
140140
* [`say`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.Say)
141-
* [`setTitle`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetTitle)
142-
* [`setStatus`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetStatus)
141+
* [`set_title`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetTitle)
142+
* [`set_status`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetStatus)
143143

144-
Within the `setStatus` utility, you can cycle through strings passed into a `loading_messages` array.
144+
Within the `set_status` utility, you can cycle through strings passed into a `loading_messages` list.
145145

146146
```python
147147
# This listener is invoked when the human user sends a reply in the assistant thread

docs/english/concepts/view-submissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ def handle_submission(ack, body, client, view, logger):
9090
# Message the user
9191
try:
9292
client.chat_postMessage(channel=user, text=msg)
93-
except e:
93+
except Exception as e:
9494
logger.exception(f"Failed to post a message {e}")
9595
```

docs/english/experiments.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
11
# Experiments
22

3-
Bolt for Python includes experimental features still under active development. These features may be fleeting, may not be perfectly polished, and should be thought of as available for use "at your own risk."
3+
Bolt for Python occasionally includes experimental features still under active development. These features may be fleeting, may not be perfectly polished, and should be thought of as available for use "at your own risk."
44

55
Experimental features are categorized as `semver:patch` until the experimental status is removed.
66

77
We love feedback from our community, so we encourage you to explore and interact with the [GitHub repo](https://github.com/slackapi/bolt-python). Contributions, bug reports, and any feedback are all helpful; let us nurture the Slack CLI together to help make building Slack apps more pleasant for everyone.
88

99
## Available experiments
10-
* [Agent listener argument](#agent)
1110

12-
## Agent listener argument {#agent}
13-
14-
The `agent: BoltAgent` listener argument provides access to AI agent-related features.
15-
16-
The `BoltAgent` and `AsyncBoltAgent` classes offer a `chat_stream()` method that comes pre-configured with event context defaults: `channel_id`, `thread_ts`, `team_id`, and `user_id` fields.
17-
18-
The listener argument is wired into the Bolt `kwargs` injection system, so listeners can declare it as a parameter or access it via the `context.agent` property.
19-
20-
### Example
21-
22-
```python
23-
from slack_bolt import BoltAgent
24-
25-
@app.event("app_mention")
26-
def handle_mention(agent: BoltAgent):
27-
stream = agent.chat_stream()
28-
stream.append(markdown_text="Hello!")
29-
stream.stop()
30-
```
11+
There are currently no active experiments. We're steadily staying stable.

docs/english/tutorial/custom-steps-workflow-builder-existing/custom-steps-workflow-builder-existing.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In this tutorial we will:
1414

1515
## Prerequisites {#prereqs}
1616

17-
The custom steps feature is compatible with Bolt version 1.20.0 and above. First, update your `package.json` file to reflect version 1.20.0 of Bolt, then run the following command in your terminal:
17+
The custom steps feature is compatible with Bolt version 1.20.0 and above. First, update your `requirements.txt` file to reflect version 1.20.0 of Bolt (e.g., `slack-bolt>=1.20.0`), then run the following commands in your terminal:
1818

1919
```sh
2020
python3 -m venv .venv
@@ -215,9 +215,8 @@ def manager_resp_handler(ack: Ack, action, body: dict, client: WebClient, comple
215215

216216
client.chat_update(
217217
channel=body['channel']['id'],
218-
message=body['message'],
219218
ts=body["message"]["ts"],
220-
text=f'Request {"approved" if request_decision == 'approve' else "denied"}!'
219+
text=f"Request {'approved' if request_decision == 'approve' else 'denied'}!"
221220
)
222221

223222
complete({

docs/english/tutorial/custom-steps-workflow-builder-new/custom-steps-workflow-builder-new.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ You can also open a terminal window from inside VSCode like this: `Ctrl` + `~`
4747
Once in VSCode, open the terminal. Let's install our package dependencies: run the following command(s) in the terminal inside VSCode:
4848

4949
```sh
50-
npm install
50+
python3 -m venv .venv
51+
source .venv/bin/activate
52+
pip install -r requirements.txt
5153
```
5254

5355
We now have a Bolt app ready for development! Open the `manifest.json` file and copy its contents; you'll need this in the next step.
@@ -99,7 +101,7 @@ You will then have a bot token. Again, copy that value and save it somewhere acc
99101

100102
## Starting your local development server {#local}
101103

102-
While building your app, you can see your changes appear in your workspace in real-time with `npm start`. Soon we'll start our local development server and see what our sample code is all about! But first, we need to store those tokens we gathered as environment variables.
104+
While building your app, you can see your changes appear in your workspace in real-time with `python app.py`. Soon we'll start our local development server and see what our sample code is all about! But first, we need to store those tokens we gathered as environment variables.
103105

104106
Navigate back to VSCode. Rename the `.env.sample` file to `.env`. Open this file and update `SLACK_APP_TOKEN` and `SLACK_BOT_TOKEN` with the values you previously saved. It will look like this, with your actual token values where you see `<your_app_token>` and `<your_bot_token>`:
105107

@@ -111,7 +113,7 @@ SLACK_BOT_TOKEN=<your_bot_token>
111113
Now save the file and try starting your app:
112114

113115
```sh
114-
npm start
116+
python app.py
115117
```
116118

117119
You'll know the local development server is up and running successfully when it emits a bunch of `[DEBUG]` statements to your terminal, the last one containing `connected:ready`.

docs/english/tutorial/custom-steps.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ Here is a sample app manifest laying out a step definition. This definition tell
111111
"name": "user_id"
112112
}
113113
},
114-
"required": {
114+
"required": [
115115
"user_id"
116-
}
116+
]
117117
},
118118
"output_parameters": {
119119
"properties": {
@@ -124,9 +124,9 @@ Here is a sample app manifest laying out a step definition. This definition tell
124124
"name": "user_id"
125125
}
126126
},
127-
"required": {
127+
"required": [
128128
"user_id"
129-
}
129+
]
130130
},
131131
}
132132
}
@@ -157,7 +157,7 @@ Notice in the example code here that the name of the step, `sample_step`, is the
157157

158158
```py
159159
@app.function("sample_step")
160-
def handle_sample_step_event(inputs: dict, fail: Fail, complete: Complete,logger: logging.Logger):
160+
def handle_sample_step_event(client: WebClient, inputs: dict, fail: Fail, complete: Complete, logger: logging.Logger):
161161
user_id = inputs["user_id"]
162162
try:
163163
client.chat_postMessage(
@@ -226,7 +226,7 @@ The second argument is the callback function, or the logic that will run when yo
226226
Field | Description
227227
------|------------
228228
`client` | A `WebClient` instance used to make things happen in Slack. From sending messages to opening modals, `client` makes it all happen. For a full list of available methods, refer to the [Web API methods](/reference/methods). Read more about the `WebClient` for Bolt Python [here](https://docs.slack.dev/tools/bolt-python/concepts/web-api/).
229-
`complete` | A utility method that invokes `functions.completeSuccess`. This method indicates to Slack that a step has completed successfully without issue. When called, `complete` requires you include an `outputs` object that matches your step definition in [`output_parameters`](#inputs-outputs).
229+
`complete` | A utility method that invokes `functions.completeSuccess`. This method indicates to Slack that a step has completed successfully without issue. When called, `complete` accepts an optional `outputs` object that matches your step definition in [`output_parameters`](#inputs-outputs).
230230
`fail` | A utility method that invokes `functions.completeError`. True to its name, this method signals to Slack that a step has failed to complete. The `fail` method requires an argument of `error` to be sent along with it, which is used to help users understand what went wrong.
231231
`inputs` | An alias for the `input_parameters` that were provided to the step upon execution.
232232

0 commit comments

Comments
 (0)