Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

SchachSebastian/discord-ai-deprecated

Repository files navigation

discord-ai [Deprecated]

Github Stars Github Forks Github Watchers GitHub License

GitHub last commit GitHub issues GitHub pull requests

Small Node.js Typescript Discord bot using the OpenAI API to answer questions.

About the project

Started developing this project to learn more about the OpenAI API and how to use it and to try integrating ai in Discord. Discord then released their own ai bot, so I decided to stop developing this project. It's still interesting to see how to use the OpenAI API and how to integrate it in a Discord bot.

Getting started

Prerequisites

Installation

Discord

  1. Create a new application on the Discord Developer Portal
  2. Create a bot for your application
  3. Copy the bot token and save it for later
  4. Invite the bot to your server and give him following permissions
    • Send Messages
    • Manage Messages
    • Read Message History
    • Add Reactions

OpenAI

  1. Create a new API key on the OpenAI Developer Portal
  2. Copy the API key and save it for later

Project

  1. Clone the repository
  2. Install dependencies with npm install
  3. Create a .env file in the root directory with the tokens inside:
DISCORD_TOKEN=<your discord bot token>
OPENAI_API_KEY=<your openai api key>
  1. Run npm run build to build the project
  2. Run npm run start to start the bot

Usage

Open the Discord server you invited the bot to and use one of the commands below.

Commands

/ai - Ask the ai a single question

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This is a small node project attempting to connect you with ChatGPT via Discord.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published