A simple Discord bot integrating OpenAI libraries for ChatGPT and DALL-E, capable of generating text and images in Discord conversations.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Formerly known as 'Aurora AI', Aurora AI is a Discord chatbot that utilizes the GPT-3.5-Turbo language model by OpenAI. Built with discord.js, it generates responses to user input in a conversational format. Designed for simplicity, it's a great tool to explore the capabilities of GPT-3.5-Turbo within Discord. Additionally, it also supports the use of DALL-E, the image generation model also developed by OpenAI, allowing it to generate creative images alongside its natural language abilities.
(back to top)
(back to top)
Get a necessary API Keys
Clone the repo
git clone https://github.com/KrozT/openai-discord.git
Install packages
pnpm install
Add the API Keys to your environment variables
DISCORD_API_KEY=<YOUR DISCORD API KEY>
OPENAI_API_KEY=<YOUR OPENAI API KEY>
Build project
pnpm run build
Start binaries
pnpm run start
(back to top)
Once you have the project initialized just add the bot to your server and enjoy.
Command | Options | Type | Description |
---|---|---|---|
/ping |
ephimeral |
embed-info |
Ping the bot to check if it is online |
/about |
ephimeral |
embed-info |
Get information about the bot |
/help |
ephimeral |
embed-info |
Get a list of all the commands |
/chat |
question ephimeral
|
embed-request embed-response
|
Chat with the bot |
/clear |
amount |
embed-info |
Clear the chat history with the bot |
/image |
prompt quantity size ephimeral
|
embed-request embed-response
|
Generate an image with the prompt provided |
Option | Command | Required | Default | Choices | Description |
---|---|---|---|---|---|
question |
/chat |
true |
None | None | The question to ask the bot |
prompt |
/image |
true |
None | None | The text to generate the image from |
quantity |
/image |
false |
1 |
1 to 10
|
Quantity of images to generate |
size |
/image |
false |
256x256 |
256x256 512x512 1024x1024
|
Size of the image to generate |
amount |
/clear |
false |
100 |
1 to 100
|
Amount of messages to clear |
ephimeral |
/ping /about /help /chat /image
|
false |
false |
true false
|
Hide the response from other users |
(back to top)
The bot uses a variety of visual embeds code located in the footer of each message. The following table describes the embeds and their colors.
Footer | Color | Description |
---|---|---|
embed-info |
Aqua | System message by the bot |
embed-error |
Red | Error message by the bot |
embed-response |
Green | Response by the bot with AI-generated content |
embed-request |
Gold | Request by the user |
(back to top)
You can add new commands to the project by following these steps:
src/bot/commands
folder with the name of the command you want to add (e.g. testCommand.ts
).Command
and implements all the methods.Command example:
import { Command } from '@/bot/models/command';
import { Client, CommandInteraction } from 'discord.js';
export class TestCommand extends Command {
public configure(): void {
this.setName('test');
this.setDescription('Test command');
this.addEphemeralOption(); // Add the ephemeral option to the command
}
protected async execute(client: Client, interaction: CommandInteraction): Promise<void> {
await interaction.reply({content: 'Test command executed', ephemeral: this.ephermeral});
}
}
(back to top)
See the open issues for a full list of proposed features (and known issues).
(back to top)
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)(back to top)
Distributed under the MIT License. See LICENSE
for more information.
(back to top)
(back to top)