Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeRunner Discord Bot

CodeRunner Logo

CodeRunner is a Discord bot built with Spring Boot and JDA (Java Discord API) that enables users to interact with AI models and execute code snippets within Discord. With a simple and intuitive command system, CodeRunner can handle AI-powered conversations and execute code snippets in real-time.

Table of Contents

Features

  • AI Conversations: Chat with an AI model powered by OpenAI via the !chat command.
  • Code Execution: Execute code snippets in multiple languages using the !run command.
  • Customizable: Easily extendable with new commands and listeners.
  • Lightweight & Scalable: Built with Spring Boot, the bot is designed to be fast and scalable, handling multiple requests simultaneously.

Getting Started

Follow these instructions to set up and run the CodeRunner bot on your local machine.

Prerequisites

Before setting up the bot, ensure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/CodeRunner.git
    cd CodeRunner
  2. Build the project using Maven:

    mvn clean install

Configuration

  1. Create the application-env.properties in the main dir.

  2. Add your configuration details:

    • BOT_TOKEN: Your Discord bot token.
    • AIBOT_TOKEN: Your OpenAI API key.

    Example:

    BOT_TOKEN=your-discord-bot-token
    AIBOT_TOKEN=your-openai-api-key

Running the Bot

To start the bot, run the following command:

mvn spring-boot:run

Alternatively, you can package the application and run the JAR file:

mvn package
java -jar target/coderunner-1.0.jar

Commands

The bot responds to several commands to interact with AI models and execute code snippets.

!chat <message>

Interact with an AI model (powered by OpenAI) and receive responses in real-time.

Example:

!chat What is the capital of France?

!run <code>

Execute a code snippet in real-time and receive the output.

Example:

!run
```python
print("Hello, world!")

Supported Code Languages

  • Python
  • JavaScript
  • Java
  • C#
  • More to be added soon!

Built With

Contributing

Contributions are welcome! If you'd like to improve CodeRunner, feel free to submit a pull request or open an issue.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages