Script Sage AI is a powerful Discord bot designed to help you generate code for various programming languages directly within your Discord server. It uses OpenAI's API to provide intelligent answers, including generating Java, Python, HTML, and more.
- Java, Python, HTML, Skript, Command Block coding: Ask Script Sage AI to generate or explain code snippets.
- Superhero Configuration for Minecraft: Generate superhero config files for the Minecraft superheroes plugin.
- Usage limits: Regular users get daily usage limits.
Example of Script Sage AI responding to a Python question.
- Node.js (v16.x or higher) and npm
- Discord bot token from the Discord Developer Portal
- OpenAI API key from OpenAI
-
Clone the repository:
git clone https://github.com/Corzed/ScriptSageAI.git cd ScriptSageAI
-
Install dependencies:
npm install
-
Set up environment variables:
Create a.env
file in the root directory and add the following:DISCORD_TOKEN=your_discord_bot_token OPENAI_API_KEY=your_openai_api_key
-
Create OpenAI Assistants:
Before using the bot, you need to create OpenAI assistants for each coding language. Visit the OpenAI Assistant Creation page to set up assistants and get their respective assistant IDs. Once created, replace the placeholder assistant IDs in the code with the actual ones:const assistants = { java: async (question) => useAssistant("your_openai_assistant_id", question), skript: async (question) => useAssistant("your_openai_assistant_id", question), commandblock: async (question) => useAssistant("your_openai_assistant_id", question), superhero: async (question) => useAssistant("your_openai_assistant_id", question), html: async (question) => useAssistant("your_openai_assistant_id", question), python: async (question) => useAssistant("your_openai_assistant_id", question), };
-
Start the bot:
npm start
Once the bot is added to your server and running, use the following commands to interact with it:
!java <question>
: Ask a Java-related coding question.!python <question>
: Ask a Python-related coding question.!html <question>
: Ask an HTML-related coding question.!skript <question>
: Ask a Minecraft Skript-related question.!commandblock <question>
: Ask a Minecraft Command Block-related question.!superhero <question>
: Generate config files for the Minecraft superheroes plugin.!usage
: Check your current usage stats.!createchannel
: Create a private channel.!help
: Display all available commands.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
If you encounter any issues or need help, feel free to open an issue in the repository or contact us on Discord. https://discord.gg/WQwPYwvH7Y
Enjoy coding with Script Sage AI!