Add slack_bot docker image (#933)

This commit is contained in:
Sidharth Mohanty
2023-11-14 02:34:04 +05:30
committed by GitHub
parent bf3fac56e4
commit 23522b7b55
3 changed files with 27 additions and 2 deletions

View File

@@ -15,8 +15,21 @@ channels:read
chat:write
```
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`.
6. Run your bot now with `python3 -m embedchain.bots.slack`
7. Expose your bot to the internet. Default port is `5000`, which can be changed by adding `port --8080` to the startup command. 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.
6. Run your bot now,
<Tabs>
<Tab title="docker">
```bash
docker run --name slack-bot -e OPENAI_API_KEY=sk-xxx -e SLACK_BOT_TOKEN=xxx -p 8000:8000 embedchain/slack-bot
```
</Tab>
<Tab title="python">
```bash
pip install --upgrade "embedchain[slack]"
python3 -m embedchain.bots.slack --port 8000
```
</Tab>
</Tabs>
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.
8. On the Slack API website go to `Event Subscriptions` on the left Sidebar and turn on `Enable Events`.
9. In `Request URL`, enter your server or ngrok address.
10. After it gets verified, click on `Subscribe to bot events`, add `message.channels` Bot User Event and click on `Save Changes`.

View File

@@ -0,0 +1,11 @@
FROM python:3.11-slim
WORKDIR /usr/src/
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "-m", "embedchain.bots.slack", "--port", "8000"]

View File

@@ -0,0 +1 @@
embedchain[slack, poe]==0.1.7