github slackapi/bolt-python v1.6.0
version 1.6.0

latest releases: v1.19.1, v1.19.0, v1.19.0rc1...
3 years ago

New Features

Code Suggestion for Missing Listeners

Since this version, the warning message for unhandled requests is even more helpful!

Let's say you've configured the "message" event subscription in the Slack App configuration page, and the Slack server-side started sending message events to your app. However, your app does not have the corresponding event listener yet. In this case, Bolt suggests the missing listener with a working code snippet.

WARNING:slack_bolt.App:Unhandled request ({'type': 'event_callback', 'event': {'type': 'message'}})
---
[Suggestion] You can handle this type of event with the following listener function:

@app.event("message")
def handle_message_events(body, logger):
    logger.info(body)

The new suggestion logging should be helpful for the developers who are new to Bolt and the Slack platform.

Options For Turning the Built-in Middleware Off

Developers can turn any of the built-in middleware off if they would like to do so for some reason.

app = App(
    token=os.environ["SLACK_BOT_TOKEN"],
    signing_secret=os.environ["SLACK_SIGNING_SECRET"],
    # Verify request signature
    request_verification_enabled = False,  # default: True
    # Skip processing the events generated by this app's bot user itself
    ignoring_self_events_enabled = False,  # default: True
    # Respond to ssl_check requests
    ssl_check_enabled = False,  # default: True
    # Respond to url_verification requests in the Events API configuration steps
    url_verification_enabled = False,  # default: True
)

Please make sure if it's safe enough when you turn a built-in middleware off. We strongly recommend using RequestVerification for better security. If you have a proxy that verifies request signature in front of the Bolt app, it's totally fine to disable RequestVerification to avoid duplication of work. Don't turn it off just for easiness of development.

Changes

References

Don't miss a new bolt-python release

NewReleases is sending notifications on new releases.