/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) In this table it is only required the key(open ai key), abled(true), messages(0) and id property(random UUID).

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
  1. Run the bot
npm start
  1. Running with auto reload(development mode)
npm run dev
  1. Updating code with changes.
npm run git

TO DO:

  • Embeds --> Future
  • Top.gg rewards --> Future
  • Uptime Robot alerts --> Future