Skip to content

edelauna/discord-bot-ai

Repository files navigation

Discord Bot AI

An interface between a Discord Server and OpenAi's ChatCompletions Api.

This is a meant to be an extension of Chat GPT into Discord, with a couple of customization features:

  • Ability to activate /channel Discord Bot Ai in a Channel
activate_channel.mov
  • Ability to set a custom system prompt /instruct within each channel.
instruct.-.HD.720p.mov
  • Ability to clear chat history /reset-messages with Discord Bot Ai.
reset-messages.-.HD.1080p.mov
  • Ability to upload file(s) and provide instructions for evaluating each file.
file-upload.-.HD.720p.mov
  • Ability to interrupt Discord Bot Ai
interupt.-.HD.1080p.mov

Installation

Pre-requisite

  1. Create a Discord app
  2. Openai API Key

Getting Started

  1. npm i
  2. Create .env file at root of project with entries for:
    TOKEN=your-discord-token
    CLIENT_ID=your-discord-app-client-id
    GUILD_ID=the-discord-server-where-youve-invited-your-app
    OPENAI_API_KEY=your-openai-api-key
  3. Create database via npm run knex:migrate:latest
  4. Deploy slash commands to your server via npm run deploy-commands
  5. Run app via npm start

Development

Follow Installation instructions.

Note

VSCode: Debug by navigating to package.json and click ▷ Debug text above scripts: Select start:dev and VSCode will run script and attach debugger.

Testing

Run npm test

Note

VSCode: Debug tests via Jest Extension.

About

Discord Bot connected to Open AI's chat GPT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages