Slack Bolt

Tools & Infrastructure 💻 Python ⚖️ MIT 🟢 Actively maintained
1.3k stars

Bolt for Python is a framework that simplifies building Slack apps by handling the underlying HTTP requests, event subscriptions, and authentication. It lets developers focus on writing app logic in Python, whether for a simple bot or a complex interactive app. It is designed for Python developers who want to create Slack apps quickly using the latest platform features.

✨ Key features

  • Supports both synchronous and asynchronous (async/await) app development.
  • Listens for events, actions, slash commands, shortcuts, and more.
  • Provides utility functions like say, respond, ack, and client for easy interactions.
  • Works with Socket Mode for local development without exposing a public endpoint.
  • Includes built-in adapters for popular web frameworks like AIOHTTP, Sanic, FastAPI.
  • Offers decorator-based listener registration for clean code.

🎯 Use cases

  • Build a Slack bot that responds to messages and mentions.
  • Create interactive apps with buttons, menus, and modals.
  • Handle slash commands to perform custom actions.
  • Integrate with external services and trigger workflows.
  • Develop custom workflow steps for Slack Workflow Builder.

📦 Installation

🧰 Requirements: Python 3.7+; Slack app with bot token and signing secret (or app token for Socket Mode); optionally aiohttp for async apps.

Python 3.7+ required
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install slack_bolt

For async apps, also install aiohttp:

pip install slack_bolt aiohttp

🚀 Usage

import logging
logging.basicConfig(level=logging.DEBUG)

from slack_bolt import App

# export SLACK_SIGNING_SECRET=***
# export SLACK_BOT_TOKEN=xoxb-***
app = App()

@app.event("app_mention")
def handle_mention(event, say):
    say(f"Hello <@{event['user']}>!")

if __name__ == "__main__":
    app.start(3000)  # POST http://localhost:3000/slack/events

Run with:

export SLACK_SIGNING_SECRET=***
export SLACK_BOT_TOKEN=xoxb-***
python app.py

❓ FAQ

How do I run the app locally?

Set the required environment variables (SLACK_SIGNING_SECRET and SLACK_BOT_TOKEN) and run python app.py. The app will start on port 3000 and listen for POST requests at /slack/events.

Can I use Socket Mode?

Yes, use SocketModeHandler from slack_bolt.adapter.socket_mode. You need an app-level token (SLACK_APP_TOKEN) with connections:write scope, and you don't need SLACK_SIGNING_SECRET or ngrok.

How do I create an async app?

Import AsyncApp from slack_bolt.async_app and define async listener functions. You must install aiohttp and use await when calling utility methods like say and ack.

What arguments are available in listener functions?

Listeners can receive body, payload, context, ack, respond, say, client, logger, complete, and fail, depending on the event type. You can also use the args object to access all available arguments.

📊 Repository

Stars★ 1,322
Forks🍴 287
Open issues🐛 27
Last commit🕒 Sep 4, 2026
Created📅 Jun 2020
Language💻 Python
License⚖️ MIT

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.