Slack Bolt for Python is a framework that makes it easy to build Slack apps using the Slack Platform. It simplifies common patterns like handling events, processing interactive components, and sending messages. The library is actively maintained with frequent releases, typically monthly, and is currently at version 1.28.0.
pip install slack-boltVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a minimal Slack Bolt app that responds to 'hello' messages in a channel. It uses Socket Mode for local development, requiring `SLACK_BOT_TOKEN`, `SLACK_SIGNING_SECRET`, and `SLACK_APP_TOKEN` environment variables. For production deployments, an HTTP adapter like Flask, Django, or AWS Lambda is typically used.
Upgrade your Python environment to 3.7 or later. The `requires_python` metadata is `^3.7`.
For production, use `AsyncApp` with an appropriate HTTP adapter (e.g., `from slack_bolt.adapter.flask import FlaskResponder`) and deploy to a web server capable of handling HTTP requests from Slack. Consult the official Bolt documentation on deployment.
Double-check your Slack App's Basic Information, OAuth & Permissions, Event Subscriptions, and Interactivity & Shortcuts settings on api.slack.com/apps. Ensure `SLACK_BOT_TOKEN`, `SLACK_SIGNING_SECRET`, and `SLACK_APP_TOKEN` (for Socket Mode) are correctly set in your application's environment variables.
Upgrade `slack-bolt` to the latest version (e.g., `pip install --upgrade slack-bolt`). Ensure your Slack App has the necessary permissions and features enabled on the Slack API dashboard, especially if using beta or experimental AI capabilities.
Ensure the `SLACK_SIGNING_SECRET` environment variable is set correctly and matches the signing secret from your Slack app's 'Basic Information' page.
Install the library using pip: `pip install slack-bolt`
Ensure the `SLACK_BOT_TOKEN` environment variable is set with your bot user OAuth token (starts with `xoxb-`), or explicitly pass `token='YOUR_BOT_TOKEN'` when initializing `App` or `WebClient`.
Go to your Slack app's configuration (api.slack.com/apps), navigate to 'OAuth & Permissions', add the required scopes (e.g., `chat:write`), and reinstall the app to your workspace.