/jda-commands

A simple yet highly customizable, annotation driven command framework for JDA

Primary LanguageJavaApache License 2.0Apache-2.0

Generic badge Codacy Badge license-shield

JDA-Commands

A simple yet highly customizable, annotation driven command framework for JDA.

Features

The focus of this framework is strongly oriented towards the reduction of boilerplate code. This goes along with the aim to reduce configuration steps that are needed before startup. Therefore IoC, Dependency Injection and Declarative Programming are the key concepts of this framework. Nevertheless, there is a high level of customization, if wanted, every part of this framework can be replaced by an own implementation.

The core features of this framework are as following:

  • Fully annotation driven command declaration
  • Argument Parsing based on method signature
  • Label shortening (comparable to auto complete)
  • Basic implementation of Dependency Injection
  • Automatic error resolving
  • Automatically generated Help Commands & Error Messages
  • Command modification at runtime
  • Guild specific settings
  • Automatic generation of documentation
  • i18n support

Example

The following example will demonstrate how easy it is to write a command:

@CommandController
public class GreetCommand {

    @Command("greet")
    public void greet(CommandEvent event, Member member) {
        event.reply("Hello %s!", member.getAsMention());
    }

}

If you want to learn more, check out the Wiki.

Download

You can download the latest version here.

Maven

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.Kaktushose</groupId>
    <artifactId>jda-commands</artifactId>
    <version>VERSION</version>
</dependency>

Gradle

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.Kaktushose:jda-commands:VERSION'
}

Contributing

If you think that something is missing and you want to add it yourself, feel free to open a pull request. Please try to keep your code quality as good as mine and stick to the core concepts of this framework.

Dependencies

The following dependencies were used to build this framework:

  • JDA
  • Reflections
  • Gson
  • slf4j-api
  • markdowngenerator