? LightDrop
LightDrop is a lightweight library that allows you to create decorator-based commands with JDA.
Features
- Creating commands in a method.
- Adding permissions and permission message.
- Catch exceptions from commands.
- Adding global filters to the command's middleware.
Installation
With maven
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>me.neiizun</groupId>
<artifactId>LightDrop</artifactId>
<version>latest</version> <!--Replace with the latest version.-->
</dependency>
</dependencies>
With gradle
repositories {
maven { url 'https://jitpack.io' }
}
repositories {
dependencies {
implementation 'com.github.NeiiZun:LightDrop:latest' // Replace with the latest version.
}
}
Usage
Hook LightDrop
JDA jda = JDABuilder.createDefault("your token").build();
new LightDrop().hook(jda);
Create your first command
public class MyCommand {
@Command(name = "mycommand")
public void myCommand(CommandContext context) {
context.getChannel().sendMessage("Hello " + context.getAuthor().getName()).complete();
}
}
JDA jda = JDABuilder.createDefault("your token").build();
new LightDrop().hook(jda)
.map(new MyCommand());