Giter Club home page Giter Club logo

jda-boot's Introduction

JDA-Boot

jda-boot is an annotation-driven jda framework that lets you create bots insanely fast

WIP

This project uses JDA by Austin Keener.

More information coming soon!

Installation

Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependecies>
	<dependency>
	    <groupId>com.github.jonafaust</groupId>
	    <artifactId>jda-boot</artifactId>
	    <version>alpha.2</version>
	</dependency>
</dependecies>

Gradle

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.jonafaust:jda-boot:alpha.2.3'
}

Roadmap

โœ… = Implemented, ๐Ÿšง = Work in Progress, โ›” = ToDo

  • โœ… Commands
  • โœ… Option Commands
  • โœ… Events
  • โœ… Embeds
  • โœ… Variable System
  • โœ… internationalization (i18n)
  • ๐Ÿšง Config System
  • โ›” Other Interactions (Buttons, Select Menus, Modals)
  • โ›” Database ORM System
  • โ›” Scheduler System
  • โ›” Configuration Classes
  • โ›” Music Implementation (LavaPlayer)

Usage

Creating a bot

public class MyBot {
    public static void main(String[] args) {
        JdaBoot.run(MyBot.class);
    }
}

Note that you need a discord.token property in your config.properties file.

Creating a command

Simple Command

@Command(name = "ping", description = "Pong!")
public class PingCommand implements SimpleCommand {
    
    @Override
    public void onCommand(CommandContext ctx) {
        ctx.reply("Pong!");
    }
}

Option Command

@Command(name = "echo", description = "Echoes a message")
public class EchoCommand implements OptionCommand {
    
    @Override
    SlashCommandData onEnable(SlashCommandData data) {
        data.addOption(OptionType.STRING, "message", "The message to echo", true);
        return data;
    }
    
    @Override
    public void onCommand(CommandContext ctx) {
        String message = ctx.getOption("message").getAsString();
        ctx.reply(message);
    }
}

Listen for events

public class ReadyListener {
    
    @EventHandler
    public void onReady(ReadyEvent event) {
        System.out.println("Bot is ready!");
    }
}

Note The method must be public and have only single parameter of the event you want to listen for. The name of the method doesn't matter. The class need to have a public no-args constructor.

jda-boot's People

Contributors

hufeisen2 avatar jonafaust avatar keksnet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.