Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devjiwonchoi/vercel-ai-slackbot
Serverless Function on Vercel to deploy the OpenAI Chat Bot for integration with Slack.
https://github.com/devjiwonchoi/vercel-ai-slackbot
ai bot function gpt openai serverless slack vercel
Last synced: about 5 hours ago
JSON representation
Serverless Function on Vercel to deploy the OpenAI Chat Bot for integration with Slack.
- Host: GitHub
- URL: https://github.com/devjiwonchoi/vercel-ai-slackbot
- Owner: devjiwonchoi
- License: mit
- Created: 2024-01-14T14:25:11.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-20T16:10:59.000Z (10 months ago)
- Last Synced: 2024-10-11T12:08:59.400Z (3 months ago)
- Topics: ai, bot, function, gpt, openai, serverless, slack, vercel
- Language: TypeScript
- Homepage: https://vercel-ai-slackbot.vercel.app
- Size: 115 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vercel AI Slack Bot
![Screenshot of usage of this project](https://github.com/devjiwonchoi/vercel-ai-slackbot/assets/120007119/eb71cacc-573c-43e5-9cb3-089850957dd6)
> Note: The bot name and icon customizable at your [Slack Apps](https://api.slack.com/apps).
## Getting Started
### Deploy on Vercel
Click on the button below to deploy this project on Vercel:
[![Deploy on Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/devjiwonchoi/vercel-ai-slackbot&env=OPENAI_API_KEY,SLACK_BOT_TOKEN,SLACK_SIGNING_SECRET)
Fill in the [Vercel Environment Variables](https://vercel.com/docs/projects/environment-variables) retrieved from the following steps and click on "Deploy".
### Environment Variables
#### OpenAI API Key
- Create a new key on [OpenAI API Keys](https://platform.openai.com/api-keys) and "Create new secret key", optionally naming the key.
- Add the key to Vercel's environment variables as `OPENAI_API_KEY`.#### Slack Bot Token & Signing Secret
Go to [Slack API Apps Page](https://api.slack.com/apps):
- Create new App
- From Scratch
- Name your app & pick a workspace
- Go to Oauth & Permissions
- Add the following scopes
- `app_mentions:read`
- `channels:history`
- `chat:write`
- `commands`
- Copy **Bot User OAuth Token**
- Add the token to Vercel's environment variables as `SLACK_BOT_TOKEN`
- Install App to workspace
- Basic Information --> Install Your App --> Install To Workspace
- App Credentials --> Coppy **Signing Secret**
- Add the secret to Vercel's environment variables as `SLACK_SIGNING_SECRET`### Enable Slack Events
After successfully deploying the app, go to [Slack API Apps Page](https://api.slack.com/apps) and select your app:
- Go to **Event Subscriptions** and enable events.
- Add the following URL to **Request URL**:
- `https://.vercel.app/api/events`
- Make sure the URL is verified, otherwise check out [Vercel Logs](https://vercel.com/docs/observability/runtime-logs) for troubleshooting.
- If verified, make sure to click **Save Changes**.
- After these changes, Slack may require reinstalling of the app.