Giter Club home page Giter Club logo

nodejs-chatgpt-discord-bot's Introduction

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.

nodejs-chatgpt-discord-bot's People

Contributors

atwellpub avatar

Stargazers

 avatar

Watchers

 avatar

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.