-
Notifications
You must be signed in to change notification settings - Fork 292
docs: fix critical inaccuracies in English documentation #1512
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Updating & pushing views | ||
|
|
||
| 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/) | ||
| 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/) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📚 praise: Fast load good I think! |
||
|
|
||
| ## The `views_update` method | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,11 @@ | ||
| # Experiments | ||
|
|
||
| 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." | ||
| 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." | ||
|
|
||
| Experimental features are categorized as `semver:patch` until the experimental status is removed. | ||
|
|
||
| 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. | ||
|
|
||
| ## Available experiments | ||
| * [Agent listener argument](#agent) | ||
|
|
||
| ## Agent listener argument {#agent} | ||
|
|
||
| The `agent: BoltAgent` listener argument provides access to AI agent-related features. | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| ### Example | ||
|
|
||
| ```python | ||
| from slack_bolt import BoltAgent | ||
|
|
||
| @app.event("app_mention") | ||
| def handle_mention(agent: BoltAgent): | ||
| stream = agent.chat_stream() | ||
| stream.append(markdown_text="Hello!") | ||
| stream.stop() | ||
| ``` | ||
| There are currently no active experiments. We're steadily staying stable. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clean 🙏 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,9 @@ You can also open a terminal window from inside VSCode like this: `Ctrl` + `~` | |
| Once in VSCode, open the terminal. Let's install our package dependencies: run the following command(s) in the terminal inside VSCode: | ||
|
|
||
| ```sh | ||
| npm install | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oopssssss
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lukegalbraithrussell A fix is great to find! Thanks! 📚 ✨ 📺 thought: We might want to prefer steps using the CLI in ongoing iteration but not a blocker for this! |
||
| python3 -m venv .venv | ||
| source .venv/bin/activate | ||
| pip install -r requirements.txt | ||
| ``` | ||
|
|
||
| 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 | |
|
|
||
| ## Starting your local development server {#local} | ||
|
|
||
| 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. | ||
| 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. | ||
|
|
||
| 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>`: | ||
|
|
||
|
|
@@ -111,7 +113,7 @@ SLACK_BOT_TOKEN=<your_bot_token> | |
| Now save the file and try starting your app: | ||
|
|
||
| ```sh | ||
| npm start | ||
| python app.py | ||
| ``` | ||
|
|
||
| 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`. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,9 +111,9 @@ Here is a sample app manifest laying out a step definition. This definition tell | |
| "name": "user_id" | ||
| } | ||
| }, | ||
| "required": { | ||
| "required": [ | ||
| "user_id" | ||
| } | ||
| ] | ||
| }, | ||
| "output_parameters": { | ||
| "properties": { | ||
|
|
@@ -124,9 +124,9 @@ Here is a sample app manifest laying out a step definition. This definition tell | |
| "name": "user_id" | ||
| } | ||
| }, | ||
| "required": { | ||
| "required": [ | ||
| "user_id" | ||
| } | ||
| ] | ||
| }, | ||
| } | ||
| } | ||
|
|
@@ -157,7 +157,7 @@ Notice in the example code here that the name of the step, `sample_step`, is the | |
|
|
||
| ```py | ||
| @app.function("sample_step") | ||
| def handle_sample_step_event(inputs: dict, fail: Fail, complete: Complete,logger: logging.Logger): | ||
| def handle_sample_step_event(client: WebClient, inputs: dict, fail: Fail, complete: Complete, logger: logging.Logger): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦠 praise: Thanks for catching this much! |
||
| user_id = inputs["user_id"] | ||
| try: | ||
| client.chat_postMessage( | ||
|
|
@@ -226,7 +226,7 @@ The second argument is the callback function, or the logic that will run when yo | |
| Field | Description | ||
| ------|------------ | ||
| `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/). | ||
| `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). | ||
| `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). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎁 praise: Thanks for catching this! |
||
| `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. | ||
| `inputs` | An alias for the `input_parameters` that were provided to the step upon execution. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 praise: Single truths are simple for me to follow thanks!