Skip to content

This is a Discord bot that uses OpenAI to provide chat functionality. It includes a short-term memory feature to allow for follow-up questions.

Notifications You must be signed in to change notification settings

gbti-network/nodejs-chatgpt-discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT Discord Bot

This is a simple Discord bot that uses OpenAI's GPT language model to chat with users. It is built with Node.js and the Discord.js library.

Requirements

  • Node.js (v14 or higher)
  • A Discord bot token (get one here)

Installation

  1. Clone the repository or download the source code
  2. Install dependencies with npm install
  3. Create a config.json file based on the config-example.json file and add your Discord bot token and OpenAI API key
  4. Start the bot with node chatgpt.js`

Usage

The bot listens for the /chat command followed by a message from the user. It then sends the message to the OpenAI API and replies to the user with the response.

Example: /chat How are you doing today?

Adding the Bot to Your Server

  1. Go to your Discord developer portal and select your application.
  2. Select "OAuth2" from the sidebar.
  3. Under "Scopes," select "bot."
  4. Under "Bot Permissions," select all permissions that the bot requires. In this case, it requires the "Send Messages" permission under "Text Permissions."
  5. Scroll back up and copy the generated OAuth2 URL.
  6. Open the OAuth2 URL in your browser and select the server you want to add the bot to.
  7. Follow the instructions to authorize the bot and add it to your server.

Note: Make sure you have the "Manage Server" permission on the server you're adding the bot to.

About

This is a Discord bot that uses OpenAI to provide chat functionality. It includes a short-term memory feature to allow for follow-up questions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published