diff --git a/docs/examples/slack_bot.mdx b/docs/examples/slack_bot.mdx index 3bae4293..034c821d 100644 --- a/docs/examples/slack_bot.mdx +++ b/docs/examples/slack_bot.mdx @@ -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, + + + ```bash + docker run --name slack-bot -e OPENAI_API_KEY=sk-xxx -e SLACK_BOT_TOKEN=xxx -p 8000:8000 embedchain/slack-bot + ``` + + + ```bash + pip install --upgrade "embedchain[slack]" + python3 -m embedchain.bots.slack --port 8000 + ``` + + +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`. diff --git a/examples/slack_bot/Dockerfile b/examples/slack_bot/Dockerfile new file mode 100644 index 00000000..1b07f204 --- /dev/null +++ b/examples/slack_bot/Dockerfile @@ -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"] diff --git a/examples/slack_bot/requirements.txt b/examples/slack_bot/requirements.txt new file mode 100644 index 00000000..71e79e6d --- /dev/null +++ b/examples/slack_bot/requirements.txt @@ -0,0 +1 @@ +embedchain[slack, poe]==0.1.7