Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<your-bot-token>
export SLACK_SIGNING_SECRET=<your-signing-secret>
export SLACK_APP_TOKEN=<your-app-level-token>
```

### 2. Setup your local project
Expand All @@ -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
```

Expand Down
14 changes: 8 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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()
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0"
__version__ = "2.0.0"