Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/english/concepts/acknowledge.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ We recommend calling `ack()` right away before initiating any time-consuming pro
:::

Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.

## Example

```python
# Example of responding to an external_select options request
@app.options("menu_selection")
Expand Down
2 changes: 2 additions & 0 deletions docs/english/concepts/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ To use an adapter, you'll create an app with the framework of your choosing and

The full list adapters, as well as configuration and sample usage, can be found within the repository's [`examples`](https://github.com/slackapi/bolt-python/tree/main/examples)

## Example

```python
from slack_bolt import App
app = App(
Expand Down
3 changes: 3 additions & 0 deletions docs/english/concepts/app-home.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
You can subscribe to the [`app_home_opened`](/reference/events/app_home_opened) event to listen for when users open your App Home.

Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.

## Example

```python
@app.event("app_home_opened")
def update_home_tab(client, event, logger):
Expand Down
2 changes: 2 additions & 0 deletions docs/english/concepts/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ For a more custom solution, you can set the `authorize` parameter to a function
- **`enterprise_id`** and **`team_id`**, which can be found in requests sent to your app.
- **`user_id`** only when using `user_token`.

## Example

```python
import os
from slack_bolt import App
Expand Down
3 changes: 3 additions & 0 deletions docs/english/concepts/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ There are two ways to respond to slash commands. The first way is to use `say()`
When setting up commands within your app configuration, you'll append `/slack/events` to your request URL.

Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.

## Example

```python
# The echo command simply echoes on command
@app.command("/echo")
Expand Down
2 changes: 2 additions & 0 deletions docs/english/concepts/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All listeners have access to a `context` dictionary, which can be used to enrich

`context` is just a dictionary, so you can directly modify it.

## Example

```python
# Listener middleware to fetch tasks from external system using user ID
def fetch_tasks(context, event, next):
Expand Down
2 changes: 2 additions & 0 deletions docs/english/concepts/custom-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Your adapter will return [an instance of `BoltResponse`](https://github.com/slac

For more in-depth examples of custom adapters, look at the implementations of the [built-in adapters](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter).

## Example

```python
# Necessary imports for Flask
from flask import Request, Response, make_response
Expand Down
2 changes: 2 additions & 0 deletions docs/english/concepts/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ If an error occurs in a listener, you can handle it directly using a try/except

By default, the global error handler will log all non-handled exceptions to the console. To handle global errors yourself, you can attach a global error handler to your app using the `app.error(fn)` function.

## Example

```python
@app.error
def custom_error_handler(error, body, logger):
Expand Down
3 changes: 3 additions & 0 deletions docs/english/concepts/global-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Global middleware is run for all incoming requests, before any listener middlewa
Both global and listener middleware must call `next()` to pass control of the execution chain to the next middleware.

Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.

## Example

```python
@app.use
def auth_acme(client, context, logger, payload, next):
Expand Down
2 changes: 2 additions & 0 deletions docs/english/concepts/listener-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ If your listener middleware is a quite simple one, you can use a listener matche

Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.

## Example

```python
# Listener middleware which filters out messages from a bot
def no_bot_messages(message, next):
Expand Down
2 changes: 2 additions & 0 deletions docs/english/concepts/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ By default, Bolt will log information from your app to the output destination. A

Outside of a global context, you can also log a single message corresponding to a specific level. Because Bolt uses Python’s [standard logging module](https://docs.python.org/3/library/logging.html), you can use any its features.

## Example

```python
import logging

Expand Down
2 changes: 2 additions & 0 deletions docs/english/concepts/opening-modals.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Read more about modal composition in the [API documentation](/surfaces/modals#co

Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.

## Example

```python
# Listen for a shortcut invocation
@app.shortcut("open_modal")
Expand Down
3 changes: 3 additions & 0 deletions docs/english/concepts/select-menu-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ To respond to options requests, you'll need to call `ack()` with a valid `option
Additionally, you may want to apply filtering logic to the returned options based on user input. This can be accomplished by using the `payload` argument to your options listener and checking for the contents of the `value` property within it. Based on the `value` you can return different options. All listeners and middleware handlers in Bolt for Python have access to [many useful arguments](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) - be sure to check them out!

Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.

## Example

```python
# Example of responding to an external_select options request
@app.options("external_action")
Expand Down
2 changes: 2 additions & 0 deletions docs/english/concepts/web-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The token used to initialize Bolt can be found in the `context` object, which is

:::

## Example

```python
@app.message("wake me up")
def say_hello(client, message):
Expand Down