Skip to content

Releases: slackapi/bolt-python

version 1.4.2

03 Mar 02:28
Compare
Choose a tag to compare

Changes

  • #246 Pass the Bolt logger in default WebClient instantiation - Thanks @seratch
  • Upgrade the minimum version of underlying slack_sdk to v3.4.1 - Thanks @seratch

References

version 1.4.1

21 Feb 03:43
Compare
Choose a tag to compare

Changes

  • #244 Fix an issue where different user's token may exist in context - Thanks @seratch

References

version 1.4.0

19 Feb 05:47
Compare
Choose a tag to compare

This release upgrades the underlying slack-sdk package from 3.3 to 3.4 (or higher). Refer to the package's release note for more details: https://github.com/slackapi/python-slack-sdk/releases/tag/v3.4.0

Changes

References

version 1.3.2

11 Feb 23:59
Compare
Choose a tag to compare

Changes

This patch version upgrades the minimum slack-sdk version from 3.3.1 to 3.3.2 for proxy issue in the built-in SocketModeClient. Also, Socket Mode adapter supports newly added proxy_headers argument in its constructor. Refer to https://github.com/slackapi/python-slack-sdk/releases/tag/v3.3.2 for the underlying changes.

References

version 1.3.1

09 Feb 08:03
Compare
Choose a tag to compare

Changes

References

version 1.3.0

05 Feb 02:49
Compare
Choose a tag to compare

This release upgrades the underlying slack-sdk package from 3.2 to 3.3. Refer to the package's release note for more details: https://github.com/slackapi/python-slack-sdk/releases/tag/v3.3.0

Changes

References

version 1.2.3

20 Jan 08:29
Compare
Choose a tag to compare

Changes

References

version 1.2.2

19 Jan 04:21
Compare
Choose a tag to compare

Changes

References

version 1.2.1

12 Jan 23:54
Compare
Choose a tag to compare

Changes

  • #203 Fix #198 bug where str subtype constraint does not work - Thanks @seratch

References

version 1.2.0

12 Jan 22:30
Compare
Choose a tag to compare

New Features

Socket Mode

This version includes support for Socket Mode, which enables developers to receive interactivy payalods and events through WebSocket connections.

https://api.slack.com/socket-mode

For WebSocket connection handling, there are four implementations including major 3rd party open-source libraries.

PyPI Project Bolt Adapter
skack_sdk slack_bolt.adapter.socket_mode.SocketModeHandler
websocket_client slack_bolt.adapter.socket_mode.websocket_client.SocketModeHandler
aiohttp (asyncio-based) slack_bolt.adapter.socket_mode.aiohttp.AsyncSocketModeHandler
websockets (asyncio-based) slack_bolt.adapter.socket_mode.websockets.AsyncSocketModeHandler

Here is a minimal working example with the built-in WebSocket client. You can switch to other implementation by changing the imports and adding the extra dependencies (websocket_client, aiohttp, websockets).

import os
from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler

# Install the Slack app and get xoxb- token in advance
app = App(token=os.environ["SLACK_BOT_TOKEN"])

if __name__ == "__main__":
    # export SLACK_APP_TOKEN=xapp-***
    # export SLACK_BOT_TOKEN=xoxb-***
    SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start()

If you want to use asyncio for everything, you can use aiohttp or websockets (along with aiohttp for AsyncWebClient). AsyncSocketModeHandler requires all of your middleware/listeners to be compatible with the async/await programming style.

from slack_bolt.app.async_app import AsyncApp
# The default is the aiohttp based implementation
from slack_bolt.adapter.socket_mode.async_handler import AsyncSocketModeHandler

app = AsyncApp(token=os.environ["SLACK_BOT_TOKEN"])

async def main():
    handler = AsyncSocketModeHandler(app, os.environ["SLACK_APP_TOKEN"])
    await handler.start_async()

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

Changes

References