Node.js 18.12.0 or newer is required
-
Install dependencies
npm install
-
Copy setting file
cp settings.json.example settings.json
-
Create Slack App here
-
Select "From an app manifest" and select workspace, you want to use this app
-
Past Manifest
Manifest
{ "display_information": { "name": "ChatGPT-Bot" }, "features": { "app_home": { "home_tab_enabled": false, "messages_tab_enabled": true, "messages_tab_read_only_enabled": false }, "bot_user": { "display_name": "ChatGPT-Bot", "always_online": false }, "slash_commands": [ { "command": "/chatgpt", "description": "ChatGPT Bot Settings", "should_escape": false } ] }, "oauth_config": { "scopes": { "bot": [ "channels:history", "channels:manage", "chat:write", "groups:history", "groups:read", "users.profile:read", "users:read", "groups:write", "commands" ] } }, "settings": { "event_subscriptions": { "bot_events": [ "message.channels", "message.groups" ] }, "interactivity": { "is_enabled": true }, "org_deploy_enabled": false, "socket_mode_enabled": true, "token_rotation_enabled": false } }
-
Copy the App ID and replace SLACK_APP_ID in settings.json
-
Click "Generate Token and Scopes"
-
Enter "ChatGPT-Bot" in Token Name and add "connections:write" scope
-
Copy the token and replace SLACK_APP_TOKEN in settings.json
-
Select "Install App" in the side menu and install ChatGPT-Bot to your workspace
-
Copy the token and replace SLACK_BOT_TOKEN in settings.json
-
Add ChatGPT-Bot to the channel integrations you want to use
-
Create OpenAI API key here
-
Replace OPENAI_API_KEY in settings.json with the obtained API key
-
Run ChatGPT-Bot
node index.js