trietphm / chatgpt-slackbot

MIT License
17 stars 7 forks source link

ChatGPT for Slack

Start an API service for interacting with ChatGPT on Slack using the OpenAI node

Note: The code is ugly because I only want to make it works and too lazy to maintain

Setup

Register for an OpenAI API Key

Sign up at https://platform.openai.com/overview and create a new API key in https://platform.openai.com/account/api-keys

Setup Slack App

Check this for the guide how to create a Slack App https://slack.dev/bolt-js/tutorial/getting-started

And you need these keys for the next step

SLACK_SIGNING_SECRET=""
SLACK_BOT_TOKEN=""
SLACK_APP_TOKEN=""

In OAuth & Permission, add these scopes to Bot Token Scopes

app_mentions:read
channels:join
chat:write
chat:write.customize
chat:write.public
im:history
im:read
im:write

Probably don't need all of them, but I'm too lazy to check, sorry

Setup your app

Usage

Ask questions

Summary Slack thread

You can send a message @YourSlackBot summary to get the summary of the current thread