Slack chatGPT AI bot

Features

OpenAI chatGPT bot for Slack app mostly used in corporate

This bot is another app to be used as a chatGPT integrated there

.env file for all generated tokens

Working

Tokens used

SLACK_BOT_TOKEN…


This content originally appeared on DEV Community and was authored by Nitin Kumar

Features

  1. OpenAI chatGPT bot for Slack app mostly used in corporate
  2. This bot is another app to be used as a chatGPT integrated there
  3. .env file for all generated tokens

Working

Image description

Tokens used

  1. SLACK_BOT_TOKEN
  2. SLACK_APP_TOKEN
  3. OPENAI_API_KEY

Applications used

  1. Slack web app
  2. Chat GPT

How to's

1. generate OpenAI token

Step 1: Navigate to openAI web app

Step 2: Login and click on Create new secret key button

Step 3: Provide a name to the token to be generated & click on Create secret key button

Step 4: Paste the token hence generated

2. Create & configure app in slack

Step 1: Navigate to Slack API web app

Step 2: Click on Create New App button

Step 3: Click from scratch >> provide App name >> Select the workspace from your profile >> Click on Create App

Step 4: Go to OAuth & Permissions from left menu bar >> Add Bot token scopes (chat:write & chat:write.public)

Step 5: Click on Install to workspace >> Click Allow button

Step 6: Copy the Bot User OAuth Token hence generated

Step 7: Go to Basic Information >> App-Level Tokens >> Generate Token and Scopes >> Provide any token name >> Add Scope (connections:write) >> Click on Generate

Step 8: Copy the token hence generated
Step 9: Go to Socket Mode & enable socket mode
Step 10: Go to Interactivity & Shortcuts & enable it(if not already)

Step 11: Go to Event Subscriptions >> enable Enable Events >> Click on **
Subscribe to bot events** >> Add Bot user events (message.im & app_mention) >> Click on Save Changes

Step 12: Now, reinstall the app (As we've done in step 5)

Step 13: Go to App Home >> Enable Allow users to send Slash commands and messages from the messages tab

How to run

  1. First run the python script
  2. Then, navigate to the slack web app and type the prompt
  3. You'll get response in slack web app

Bibliography

Linkedin post

GitHub Repo

Reference YouTube Link

Author

Nitin Kumar

Keep building bots !!


This content originally appeared on DEV Community and was authored by Nitin Kumar


Print Share Comment Cite Upload Translate Updates
APA

Nitin Kumar | Sciencx (2024-07-10T20:41:40+00:00) Slack chatGPT AI bot. Retrieved from https://www.scien.cx/2024/07/10/slack-chatgpt-ai-bot/

MLA
" » Slack chatGPT AI bot." Nitin Kumar | Sciencx - Wednesday July 10, 2024, https://www.scien.cx/2024/07/10/slack-chatgpt-ai-bot/
HARVARD
Nitin Kumar | Sciencx Wednesday July 10, 2024 » Slack chatGPT AI bot., viewed ,<https://www.scien.cx/2024/07/10/slack-chatgpt-ai-bot/>
VANCOUVER
Nitin Kumar | Sciencx - » Slack chatGPT AI bot. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/10/slack-chatgpt-ai-bot/
CHICAGO
" » Slack chatGPT AI bot." Nitin Kumar | Sciencx - Accessed . https://www.scien.cx/2024/07/10/slack-chatgpt-ai-bot/
IEEE
" » Slack chatGPT AI bot." Nitin Kumar | Sciencx [Online]. Available: https://www.scien.cx/2024/07/10/slack-chatgpt-ai-bot/. [Accessed: ]
rf:citation
» Slack chatGPT AI bot | Nitin Kumar | Sciencx | https://www.scien.cx/2024/07/10/slack-chatgpt-ai-bot/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.