{"id":1711,"library":"slack-bolt","title":"Slack Bolt for Python","description":"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.","status":"active","version":"1.28.0","language":"en","source_language":"en","source_url":"https://github.com/slackapi/bolt-python","tags":["slack","bot","chat","api","framework","async"],"install":[{"cmd":"pip install slack-bolt","lang":"bash","label":"Install Bolt"}],"dependencies":[{"reason":"Commonly used for loading environment variables in local development.","package":"python-dotenv","optional":true}],"imports":[{"symbol":"App","correct":"from slack_bolt import App"},{"note":"Use AsyncApp for asynchronous operations and improved performance, especially with ASGI servers.","symbol":"AsyncApp","correct":"from slack_bolt.async_app import AsyncApp"},{"note":"Required for local development and connecting to Slack via WebSockets.","symbol":"SocketModeHandler","correct":"from slack_bolt.adapter.socket_mode import SocketModeHandler"},{"note":"One of several HTTP adapters for deploying Bolt apps to web servers.","symbol":"FlaskResponder","correct":"from slack_bolt.adapter.flask import FlaskResponder"}],"quickstart":{"code":"import os\nfrom slack_bolt import App\nfrom slack_bolt.adapter.socket_mode import SocketModeHandler\n\n# Initialize your app with your bot token and signing secret\n# Ensure SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET, and SLACK_APP_TOKEN are set in your environment\napp = App(\n    token=os.environ.get(\"SLACK_BOT_TOKEN\", \"\"),\n    signing_secret=os.environ.get(\"SLACK_SIGNING_SECRET\", \"\")\n)\n\n# Listen for messages containing \"hello\"\n@app.message(\"hello\")\ndef message_hello(message, say):\n    # say() sends a message to the same channel where the event was triggered\n    say(f\"Hey there <@{message['user']}>!\")\n\n# Start your app\n# For local development, Socket Mode is often used.\n# For production, you'd typically use an HTTP adapter (e.g., Flask, AWS Lambda).\nif __name__ == \"__main__\":\n    # SLACK_APP_TOKEN is required for Socket Mode\n    SocketModeHandler(app, os.environ.get(\"SLACK_APP_TOKEN\", \"\")).start()","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.7 or later. The `requires_python` metadata is `^3.7`.","message":"Python 3.6 support has been officially dropped. Applications running on Python 3.6 will need to upgrade to Python 3.7 or newer.","severity":"breaking","affected_versions":">=1.25.0"},{"fix":"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.","message":"Deployment strategies differ significantly for local development versus production. `App.start()` or `SocketModeHandler` is for local Socket Mode development. For production, you must use an HTTP adapter (e.g., `FlaskResponder`, `AwsLambdaPythonReceiver`) and expose an endpoint for Slack to send events.","severity":"gotcha","affected_versions":"all"},{"fix":"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.","message":"All Slack apps require careful configuration within api.slack.com/apps, including setting correct OAuth Scopes, enabling Event Subscriptions, and verifying the Slack Signing Secret. Many errors (e.g., 401 Unauthorized, events not being received) stem from misconfigurations or missing environment variables.","severity":"gotcha","affected_versions":"all"},{"fix":"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.","message":"New AI-enabled features like `say_stream` and `set_status` (for streaming messages and showing loading states) introduced in v1.26.0 and v1.28.0 require specific Bolt versions and may depend on the latest Slack platform features. If these methods are not available or behave unexpectedly, check your Bolt version and Slack app setup.","severity":"gotcha","affected_versions":"<1.26.0"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}