capibawa / wumpus-gpt

ChatGPT-like Discord chatbot written in TypeScript and powered by OpenAI's `gpt-4` and `gpt-3.5-turbo` language models.
https://discord.com/api/oauth2/authorize?client_id=1054835849893793872&permissions=397284550656&scope=bot
MIT License
26 stars 19 forks source link
bot chatbot chatgpt discord discord-bot discord-js gpt-3 gpt-4 gpt3 gpt4 openai typescript

WumpusGPT

Discord

WumpusGPT is a Discord chatbot written in TypeScript and powered by OpenAI's gpt-4 and gpt-3.5-turbo language models.

Although WumpusGPT is not quite the same as ChatGPT, they both utilize the same language model so you will yield very similar results.

Built with OpenAI Node.js Library and discord.js. Inspired by OpenAI's GPT Discord Bot.

You can invite the bot to your server by clicking here.

Roadmap

Warning This is a work in progress. Feel free to contribute!

Features

Get Started

  1. Copy .env.example to .env and fill in the values as detailed below

  2. Create a MySQL database (I recommend PlanetScale if you don't want to host locally) and fill in DATABASE_URL

  3. Create a Discord application at https://discord.com/developers/applications

  4. Go to the Bot tab and click "Add Bot"

    • Click "Reset Token" and fill in DISCORD_TOKEN
    • Disable "Public Bot" unless you want your bot to be visible to everyone
    • Enable "Server Members Intent" and "Message Content Intent" under "Privileged Gateway Intents"
  5. Go to the OAuth2 tab, copy your "Client ID", and fill in DISCORD_CLIENT_ID

  6. Go to https://beta.openai.com/account/api-keys, create an API key, and fill in OPENAI_API_KEY

  7. Feel free to set OPENAI_MODEL if you have access to gpt-4, otherwise gpt-3.5-turbo is the default

  8. Install dependencies and run the bot

    npm install
    npm start

    Or run the bot in a Docker image:

    docker-compose up -d
    docker-compose logs -t wumpus-gpt-discord-bot

    You should see an invite URL in the console. Copy and paste it into your browser to add the bot to your server.

  9. Start chatting with the bot via the /chat or /ask commands

License

Licensed under the MIT license.