-
Notifications
You must be signed in to change notification settings - Fork 0
02) Getting Started
ly.ton edited this page May 4, 2018
·
2 revisions
Follow the guide above if you haven't used JDA before. Here are some quick examples to get you started. See the following pages for more information.
//creating the builder
BreadBotClientBuilder builder = new BreadBotClientBuilder();
//adding the command
builder.addCommand(event -> event.send("pong"), command -> command.setKeys("ping"));
//building the command client
BreadBotClient client = builder.build();
JDA jda = new JDABuilder()
...
.addListener(client)
.buildAsync();
It is important to add the BreadBotClient to JDA as an EventListener
public class PingPong {
@MainCommand
public void ping(CommandEvent event) {
event.send("pong");
}
}
BreadBotClientBuilder builder = new BreadBotClientBuilder();
builder.addCommand(PingPong.class)
...
public class PingPong {
@MainCommand
public String ping() {
return "pong";
}
}
BreadBotClientBuilder builder = new BreadBotClientBuilder();
builder.addCommand(PingPong.class)
...