/chatgpt-discord-bot

A discord bot for interact with ChatGPT

Primary LanguageTypeScriptApache License 2.0Apache-2.0

chatgpt-bot

A discord bot for interact with ChatGPT ko-fi

Setup Guide

  1. Clone repository
    git clone https://github.com/MrlolDev/chatgpt-discord-bot.git
  1. Create supabase project

  2. Create supabase tables

Table: accounts Fields (name, dataType): (id,uuid), (created_at, timestamp), (email, text), (password, text), (abled, boolean), (totalMessages, numeric), (lastUse, numeric), (key, text), (session, text), (shard,numeric)

Table: chatsonic Fields (name, dataType): (id,uuid), (created_at, timestamp), (key, text)

Table: conversations Fields (name, dataType): (id,uuid), (created_at, timestamp), (account, uuid, foreign key points to Account) , (conversation, jsonb), (lastMessage, numeric), (userId, text)

Table: cooldown Fields (name, dataType): (id,uuid), (created_at, timestamp), (userId, text), (command, text)

Table: results Fields (name, dataType): (id,uuid), (created_at, timestamp), (prompt, text), (provider, text), (result, jsonb), (uses, numeric), (guildId, text)

  1. Upload open ai accounts

  2. Install dependencies

npm install
  1. Create .env
TOKEN=Your discord bot token https://discord.dev
CLIENT_ID=Your discord bot id https://discord.dev
SUPABASE_KEY=Your supabase service role key https://app.supabase.com
SUPABASE_URL=Your supabase project url https://app.supabase.com
NOPECHA_KEY=Your nopecha key https://nopecha.com
  1. Run the bot
npm start
  1. Running with auto reload(development mode)
npm run dev
  1. Updating code with changes.
npm run git

Get session key

  1. Go to https://chat.openai.com/chat
  2. Log in to your account
  3. Open developer tools
  4. Go to the application section
  5. Go to the cookies section
  6. And get your session token which is the cookie with the name: "__Secure-next-auth.session-token"

TO DO:

  • Chat command with ChatGPT response. --> 0.0.2
  • Conversations support(the bot have context from the previous messages). --> 0.0.3
  • Bot command(get information about the bot and the ping bot). --> 0.0.3
  • Feedback command(allow people to send feedback). --> 0.0.4
  • Auto refresh session token --> 0.0.5
  • Includes user message in chat command. --> 0.0.6
  • Solve ChatGPT issues --> 0.0.6
  • Limits to 1 conversation per channel. --> 0.0.6
  • Host on vps server --> 0.0.7
  • Allow private conversations --> 0.0.9
  • Embeds --> 0.0.9
  • Top.gg rewards --> Future
  • Partials responses during loading --> Future
  • Uptime Robot alerts --> Future