Java library for easier use of JDA
Checkout releases and download the latest jar with all required dependencies.
class Main {
public static void main(String[] args) {
JDA jda = JDABuilder.createDefault("Your token").build();
JApi.init(jda, "your prefix", true);
new Command("commandName", (event) -> {
event.reply("cool");
});
}
}
class Main {
public static void main(String[] args) {
JDA jda = JDABuilder.createDefault("Your token").build();
JApi.init(jda, "your prefix", true);
// Required
JApi.createSlashCommandSupport(true, null);
JApi.setTestGuildId("You test guild id");
new SlashCommand("command", "description", true, (event) -> {
event.reply("pong!");
});
}
}
But if you want arguments:
class Main {
public static void main(String[] args) {
JDA jda = JDABuilder.createDefault("Your token").build();
JApi.init(jda, "your prefix", true);
// Required
JApi.createSlashCommandSupport(true, null);
JApi.setTestGuildId("You test guild id");
new SlashCommand("command", "description", true, new OptionData[] {
new OptionData(OptionType.STRING, "name", "description", true)
} ,(event) -> {
event.reply("yup");
});
}
}
- Buttons
- Applications
GamestationCZ#4663