repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: '💼 Slack Bot' |
| #3 | --- |
| #4 | |
| #5 | ### 🖼️ Setup |
| #6 | |
| #7 | 1. Create a workspace on Slack if you don't have one already by clicking [here](https://slack.com/intl/en-in/). |
| #8 | 2. Create a new App on your Slack account by going [here](https://api.slack.com/apps). |
| #9 | 3. Select `From Scratch`, then enter the Bot Name and select your workspace. |
| #10 | 4. On the left Sidebar, go to `OAuth and Permissions` and add the following scopes under `Bot Token Scopes`: |
| #11 | ```text |
| #12 | app_mentions:read |
| #13 | channels:history |
| #14 | channels:read |
| #15 | chat:write |
| #16 | ``` |
| #17 | 5. Now select the option `Install to Workspace` and after it's done, copy the `Bot User OAuth Token` and set it in your secrets as `SLACK_BOT_TOKEN`. |
| #18 | 6. Run your bot now, |
| #19 | <Tabs> |
| #20 | <Tab title="docker"> |
| #21 | ```bash |
| #22 | docker run --name slack-bot -e OPENAI_API_KEY=sk-xxx -e SLACK_BOT_TOKEN=xxx -p 8000:8000 embedchain/slack-bot |
| #23 | ``` |
| #24 | </Tab> |
| #25 | <Tab title="python"> |
| #26 | ```bash |
| #27 | pip install --upgrade "embedchain[slack]" |
| #28 | python3 -m embedchain.bots.slack --port 8000 |
| #29 | ``` |
| #30 | </Tab> |
| #31 | </Tabs> |
| #32 | 7. Expose your bot to the internet. You can use your machine's public IP or DNS. Otherwise, employ a proxy server like [ngrok](https://ngrok.com/) to make your local bot accessible. |
| #33 | 8. On the Slack API website go to `Event Subscriptions` on the left Sidebar and turn on `Enable Events`. |
| #34 | 9. In `Request URL`, enter your server or ngrok address. |
| #35 | 10. After it gets verified, click on `Subscribe to bot events`, add `message.channels` Bot User Event and click on `Save Changes`. |
| #36 | 11. Now go to your workspace, right click on the bot name in the sidebar, click `view app details`, then `add this app to a channel`. |
| #37 | |
| #38 | ### 🚀 Usage Instructions |
| #39 | |
| #40 | - Go to the channel where you have added your bot. |
| #41 | - To add data sources to the bot, use the command: |
| #42 | ```text |
| #43 | add <data_type> <url_or_text> |
| #44 | ``` |
| #45 | - To ask queries from the bot, use the command: |
| #46 | ```text |
| #47 | query <question> |
| #48 | ``` |
| #49 | |
| #50 | 🎉 Happy Chatting! 🎉 |
| #51 |