github slackapi/bolt-python v1.16.0
version 1.16.0

latest releases: v1.21.2, v1.21.1, v1.21.0...
23 months ago

New Features

ASGI Adapter

Since this version, a new adapter that implements the ASGI standard is available. The novel adapter brings the following benefits to developers:

  • A builtin way to deploy HTTP apps to production using the ASGI standard
  • Allow bolt to be deployed on a web servers such as daphne, uvicorn and hypercorn without other dependencies
  • A way to create small, lightweight and efficient docker images for bolt python

The adapter is compatible with both App and AsyncApp. You can run both of the following app code by running uvicorn app:api --reload --port 3000 --log-level debug:

from slack_bolt import App
from slack_bolt.adapter.asgi import SlackRequestHandler

app = App()

@app.event("app_mention")
def handle_app_mentions(say):
    say("What's up?")

api = SlackRequestHandler(app)

Here is an asyncio-based app:

from slack_bolt.async_app import AsyncApp
from slack_bolt.adapter.asgi.async_handler import AsyncSlackRequestHandler

app = AsyncApp()

@app.event("app_mention")
async def handle_app_mentions(say):
    await say("What's up?")

api = AsyncSlackRequestHandler(app)

To learn more on the implementation and grab more code examples, please check @WilliamBergamin's pull request adding the feature: #780

Changes

Document / Project Updates

References

Don't miss a new bolt-python release

NewReleases is sending notifications on new releases.