3 Commits

Author SHA1 Message Date
0cae3e60f4 fix formatting 2026-04-26 13:34:59 -07:00
d72247b5f9 fix step 3 of setup 2026-04-26 12:20:39 -07:00
42fc11b2a3 Merge branch 'feature/docker-compose'
* feature/docker-compose:
  update gitignore
  update readme/setup/todo for docker-compose approach
  add docker-compose file and Dockerfile
2026-04-26 12:10:00 -07:00
3 changed files with 8 additions and 4 deletions

View File

@@ -129,11 +129,12 @@ The app-level token (`xapp-...`) is what Socket Mode uses to open a WebSocket co
## Step 3 — Get the Bot User OAuth Token ## Step 3 — Get the Bot User OAuth Token
If you haven't copied it already:
1. In the left sidebar, click **OAuth & Permissions** 1. In the left sidebar, click **OAuth & Permissions**
2. At the top of the page, find **Bot User OAuth Token** 2. Scroll to the **OAuth Tokens** section — if you see a **Bot User OAuth Token** starting with `xoxb-`, copy it and skip ahead to Step 4
3. Copy it — it starts with `xoxb-` 3. If no token is shown, click **Install to Workspace** (you may see this button at the top of the page or in the **Install App** sidebar section)
4. Review the permissions and click **Allow**
5. After the confirmation step, you'll be redirected back — your **Bot User OAuth Token** (`xoxb-…`) will now appear under **OAuth Tokens**
6. Copy it
> **If you change scopes later**, you must reinstall the app for the token to pick up the new permissions. Go to **Install App** → **Reinstall to Workspace**. > **If you change scopes later**, you must reinstall the app for the token to pick up the new permissions. Go to **Install App** → **Reinstall to Workspace**.

2
bot.py
View File

@@ -5,6 +5,7 @@ import time
import logging import logging
import requests import requests
from md2mrkdwn import convert as md_to_slack
from slack_bolt import App from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler from slack_bolt.adapter.socket_mode import SocketModeHandler
@@ -105,6 +106,7 @@ def handle_mention(event, client, say):
response.raise_for_status() response.raise_for_status()
data = response.json() data = response.json()
reply_text = data["choices"][0]["message"]["content"] reply_text = data["choices"][0]["message"]["content"]
reply_text = md_to_slack(reply_text)
# Post the reply # Post the reply
if len(reply_text) <= MAX_INLINE_LENGTH: if len(reply_text) <= MAX_INLINE_LENGTH:

View File

@@ -1,2 +1,3 @@
slack-bolt==1.28.0 slack-bolt==1.28.0
requests==2.33.1 requests==2.33.1
md2mrkdwn==0.4.3