Giter Club home page Giter Club logo

chatgpt-slackbot's Introduction

NOTICE: openai.com has limit its token permisson, so this repo fail to work, will resume this repo when openai.com officially support ChatGPT API

chatgpt as slack bot

chatgpt inside slack

FEATURES

  • Set the chatgpt token by command /set-chatgpt-token
  • Talk with @ChatGPT in DM channel
  • Invite the @ChatGPT then direct, then mention @ChatGPT to talk with ChatGPT
  • Conversation by channel
    • each channel (DM, group, public channel etc) give one conversation
    • reset the channel conversation by /reset-chatgpt-conversation

Setup Slack Bot by Web site

click Add To Slack

Setup from Zero

Goal: we will step by step to fill the .env properties

create a slack app in your workspace

  • open socket mode
  • set the App Display name as your need
  • Add bot user since we want to mention @ChatGPT to let it work

setup scopes

goto app oauth page: https://api.slack.com/apps//oauth, make Scopes as: setup scope

  • where chat:write can direct talk in im
  • where app_mentions:read can @ChatGPT to talk in channel

setup commands

make Scopes as: setup command where

  • /chatgpt Command to direct send question to ChatGPT
  • /reset-chatgpt-conversation Command to reset the conversation thread to cleanup the context
  • /set-chatgpt-token Command to globally set new Bearer Auth token which are copied from ChatGPT website
  • /print-chatgpt-token Command to print current Bearer Auth token

Finally, we can setup such following values in .env file

  • Find in the Oauth & Permissions tab SLACKBOT_TOKEN=xoxb-
  • Find in Basic Information Tab SLACKBOT_SIGNING_SECRET=
  • Token from the App-level Token that we created SLACKBOT_APP_TOKEN=xapp-xxx

copy the Bearer Auth token from ChatGPT website

how to copy auth token put into .env file CHATGPT_AUTH_TOKEN=<copied token value>

  • you can use /set-chatgpt-token to setup the token for update, e.g. you may need reset the thread, and don't want to reset the bot server.

run the bot app

git clone
npm i
npm run build
npm run start

then you can use ChatGPT in Slack.

Docker run

docker build -t chatgpt-slackbot
docker run -it --rm chatgpt-slackbot

Discord support

Join Discord to support

Have Fun with ChatGPT inside Slack!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.