From 92658bd21918fc7dcfeb9bb73458f2eab68e7b2e Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Thu, 15 Jul 2021 14:24:13 +1000 Subject: [PATCH 1/6] Change default example to socket mode --- README.md | 8 ++------ app.py | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) 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..43bb176 100644 --- a/app.py +++ b/app.py @@ -1,10 +1,10 @@ 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"), ) @@ -37,4 +37,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() From 109a0d612f11f343772a914f224139086353df18 Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Thu, 15 Jul 2021 14:24:41 +1000 Subject: [PATCH 2/6] Tweak --- app.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app.py b/app.py index 43bb176..abb6154 100644 --- a/app.py +++ b/app.py @@ -3,9 +3,7 @@ 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"), -) +app = App(token=os.environ.get("SLACK_BOT_TOKEN")) # Listens to incoming messages that contain "hello" From 20d3e12f4eff7ea54bc270aad4f0030547911651 Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Wed, 4 Aug 2021 10:58:35 -0700 Subject: [PATCH 3/6] Add note --- app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.py b/app.py index abb6154..775a3c7 100644 --- a/app.py +++ b/app.py @@ -2,6 +2,10 @@ from slack_bolt import App from slack_bolt.adapter.socket_mode import SocketModeHandler +# 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 and signing secret app = App(token=os.environ.get("SLACK_BOT_TOKEN")) From d0278df836c28f3d01384828a113394045e20d0c Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Wed, 4 Aug 2021 13:07:30 -0700 Subject: [PATCH 4/6] Release commit --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From 184543cb8407cd3a2ac00b7a57cd2062f227383b Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Wed, 4 Aug 2021 13:11:13 -0700 Subject: [PATCH 5/6] Update comment --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 775a3c7..a21e61a 100644 --- a/app.py +++ b/app.py @@ -6,7 +6,7 @@ # For the companion getting started setup guide, # see: https://slack.dev/bolt-python/tutorial/getting-started -# Initializes your app with your bot token and signing secret +# Initializes your app with your bot token app = App(token=os.environ.get("SLACK_BOT_TOKEN")) From 991296071988aaa68e3effeef2b9559b7f282326 Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Wed, 4 Aug 2021 13:51:48 -0700 Subject: [PATCH 6/6] Add maintainers not --- .github/maintainers_guide.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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)