- Go to the Slack API Website: https://api.slack.com/
- Click on "Create an app" and select "From scratch"
- Give your app a name, select your Slack workspace
- In Basic information > Add features and functionality. Click on "Permissions" and in Scopes add in Bot Token Scopes:
chat:write
,im:history
,im:read
,im:write
- In settings, click on "Socket Mode", enable it and give the token a name. Copy the Slack App Token.
- In Basic information > Add features and functionality. Click on "Event Subscriptions" and enable it. Under "Subscribe to bot events" select
message.im
. Save changes. - Go to "OAuth & Permissions" section and install your app to your workspace
- Copy the Slack Bot Token
- Go to your App's Basic Information screen and copy the Signing Secret*
- Under App Home, make sure you select "Allow users to send Slash commands and messages from the messages tab"
- Go to the OpenAI API website
- Log in or sign up for an OpenAI account
- Go to the API Key section (https://platform.openai.com/account/api-keys) and create a new API key
- Copy the API Key
- Clone this repository:
git clone [email protected]:gmalca/slackgpt.git
- Enter directory:
cd slackgpt
- Install dependencies:
npm install
- Rename
.env.example
to.env
- Edit
.env
and add yourSLACK_SIGNING_SECRET
(Slack Instructions Step 9),SLACK_BOT_TOKEN
(Slack Instructions Step 8),SLACK_APP_TOKEN
(Slack Instructions Step 5) andOPENAI_API_KEY
(OpenAI Instructions Step 4) - Run the app:
npm start server.js