Rubber Duck Trainer is an AI-powered Discord bot that detects and responds to unnecessary or poorly explained questions, encouraging users to improve their question-asking skills.
- Features
- Project Structure
- Prerequisites
- Installation
- Usage
- Commands
- Contributing
- Acknowledgements
- License
- Keyword detection in Discord messages (currently in Turkish, English support coming soon)
- Integration with OpenAI's GPT-4o mini model for intelligent responses
- Automatic warning messages for unnecessary or poorly explained questions
- Customizable cooldown for command usage
The project is divided into two main components:
discord-bot/: Contains the Discord bot application- Detects specific keywords in messages
- Communicates with the AI service
ai-service/: Contains the AI service- Processes messages using OpenAI's GPT-4o mini model
- Generates appropriate responses
- Node.js
- Discord Bot Token
- OpenAI API Key
- Discord Bot Client ID (obtained from the Discord Developer Portal)
- Discord Server (Guild) ID
-
Clone the repository:
git clone https://github.com/aksuharun/rubber-duck-trainer.git cd rubber-duck-trainer -
Install dependencies for both the Discord bot and AI service:
cd discord-bot npm install cd ../ai-service npm install -
Set up environment variables:
- Copy or rename the
.env.examplefile to.envin bothdiscord-bot/andai-service/directories - Fill in the required values in each
.envfile
- Copy or rename the
-
Configure the Discord bot:
- Open
discord-bot/config.js - Replace the placeholder values with your actual Discord bot client ID and guild ID:
const config = { clientID: "Your Discord bot client ID here", guildID: "Your Discord server (guild) ID here" }
- Open
-
Ensure all required values are filled:
- In the
.envfiles: Discord Bot Token, OpenAI API Key - In
config.js: Client ID, Guild ID
- In the
Failure to provide these values will result in the application not functioning correctly.
-
Start the AI service:
cd ai-service npm start -
In a separate terminal, start the Discord bot:
cd discord-bot npm start -
Invite the bot to your Discord server using the OAuth2 URL generated in the Discord Developer Portal.
-
The bot will now respond to messages containing the Turkish keyword "var mı" (case-insensitive) and provide warnings for unnecessary or poorly explained questions. English support will be added in a future update.
/ping: A simple command to check if the bot is responsive.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License
Copyright (c) 2024 Harun Aksu
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.