Skip to content

Commit e243e7d

Browse files
authored
Initial submission (#1)
1 parent 95c64f2 commit e243e7d

25 files changed

+376
-305
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
2-
max-line-length = 125
2+
max-line-length = 200
33
exclude = .gitignore,venv

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ tmp.txt
3535
.DS_Store
3636
logs/
3737
*.db
38-
.pytype/
38+
.pytype/
39+
.idea/

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Bolt for Python Template App
1+
# App Assistant Sample (Bolt for Python)
22

3-
This is a generic Bolt for Python template app used to build out Slack apps.
3+
This Bolt for Python sample app demonstrates how to use [Agents & Assistants](https://api.slack.com/docs/apps/ai) in Slack.
44

55
Before getting started, make sure you have a development workspace where you have permissions to install apps. If you don’t have one setup, go ahead and [create one](https://slack.com/create).
66
## Installation
@@ -22,15 +22,17 @@ Before you can run the app, you'll need to store some environment variables.
2222
# Replace with your app token and bot token
2323
export SLACK_BOT_TOKEN=<your-bot-token>
2424
export SLACK_APP_TOKEN=<your-app-token>
25+
# This sample uses OpenAI's API by default, but you can switch to any other solution!
26+
export OPENAI_API_KEY=<your-openai-api-key>
2527
```
2628

2729
### Setup Your Local Project
2830
```zsh
2931
# Clone this project onto your machine
30-
git clone https://github.com/slack-samples/bolt-python-starter-template.git
32+
git clone https://github.com/slack-samples/bolt-python-app-assistant.git
3133

3234
# Change into this project directory
33-
cd bolt-python-starter-template
35+
cd bolt-python-app-assistant
3436

3537
# Setup your python virtual environment
3638
python3 -m venv .venv

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from listeners import register_listeners
88

99
# Initialization
10-
app = App(token=os.environ.get("SLACK_BOT_TOKEN"))
1110
logging.basicConfig(level=logging.DEBUG)
11+
app = App(token=os.environ.get("SLACK_BOT_TOKEN"))
1212

1313
# Register Listeners
1414
register_listeners(app)

app_oauth.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ def failure(args: FailureArgs) -> BoltResponse:
3232
oauth_settings=OAuthSettings(
3333
client_id=os.environ.get("SLACK_CLIENT_ID"),
3434
client_secret=os.environ.get("SLACK_CLIENT_SECRET"),
35-
scopes=["channels:history", "chat:write", "commands"],
35+
scopes=[
36+
"assistant:write",
37+
"im:history",
38+
"chat:write",
39+
"channels:join", # required only for the channel summary
40+
"channels:history", # required only for the channel summary
41+
"groups:history", # required only for the channel summary
42+
],
3643
user_scopes=[],
3744
redirect_uri=None,
3845
install_path="/slack/install",

listeners/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
from listeners import actions
2-
from listeners import commands
31
from listeners import events
4-
from listeners import messages
5-
from listeners import shortcuts
6-
from listeners import views
72

83

94
def register_listeners(app):
10-
actions.register(app)
11-
commands.register(app)
125
events.register(app)
13-
messages.register(app)
14-
shortcuts.register(app)
15-
views.register(app)

listeners/actions/__init__.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

listeners/actions/sample_action.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

listeners/commands/__init__.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

listeners/commands/sample_command.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)