diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index ae59a31..34c8f37 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -43,10 +43,9 @@ $ source .venv/bin/activate ### Updating -This repository is a dependency for our guides and other example apps. -When making changes, it's important to keep all of our other guides and apps up-to-date. +This package is a dependency for our guides and other example apps. There are many ways to configure a sample app. We prefer to keep a single version of `app.js` which should be consistent with the instructions and code blocks on the [Bolt JS Getting Started guide](https://slack.dev/bolt-js/tutorial/getting-started). This reduces the possibility of drift ocurring between multiple versions. -When updating this repository, please ensure the following are also updated: +When making changes to this repo, it's also important to keep all of our other guides and apps up-to-date. - Guides found at [slackapi/bolt-python/docs/](https://github.com/slackapi/bolt-python/tree/main/docs) - Example apps at [slackapi/bolt-python/examples/](https://github.com/slackapi/bolt-python/tree/main/examples) diff --git a/README.md b/README.md index 4abcefe..d85dec3 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ responding to events and interactive buttons. ### 1. Setup environment variables ```zsh -# Replace with your signing secret and token +# Replace with your tokens export SLACK_BOT_TOKEN= -export SLACK_SIGNING_SECRET= +export SLACK_APP_TOKEN= ``` ### 2. Setup your local project @@ -34,11 +34,7 @@ pip install -r requirements.txt ``` ### 3. Start servers - -[Setup ngrok][3] to create a local requests URL for development. - ```zsh -ngrok http 3000 python3 app.py ``` diff --git a/app.py b/app.py index dc99362..a21e61a 100644 --- a/app.py +++ b/app.py @@ -1,11 +1,13 @@ import os from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler -# Initializes your app with your bot token and signing secret -app = App( - token=os.environ.get("SLACK_BOT_TOKEN"), - signing_secret=os.environ.get("SLACK_SIGNING_SECRET"), -) +# This sample slack application uses SocketMode +# For the companion getting started setup guide, +# see: https://slack.dev/bolt-python/tutorial/getting-started + +# Initializes your app with your bot token +app = App(token=os.environ.get("SLACK_BOT_TOKEN")) # Listens to incoming messages that contain "hello" @@ -37,4 +39,4 @@ def action_button_click(body, ack, say): # Start your app if __name__ == "__main__": - app.start(port=int(os.environ.get("PORT", 3000))) + SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() diff --git a/version.py b/version.py index 5becc17..8c0d5d5 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -__version__ = "1.0.0" +__version__ = "2.0.0"