Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.03 KB

README.md

File metadata and controls

36 lines (28 loc) · 1.03 KB

b4dis

JDA Brigadier Parser Plugin.

We want to thank the Concordia University Part-time Faculty Association for the Professional Development Grant that allows us to develop/contribute to the open source community. 

Following is the typical ping pong example for the Discord API. Command registration works essentially the same way as on Minecraft Forge (which is why this package was developed).

Ping Pong Example

DiscordBrigadier discordBrigadier = new DiscordBrigadier();

discordBrigadier.register(
    DiscordBrigadier
        .literal("ping")
        .executes(context -> {
            context
                .getSource()
                .getTextChannel()
                .sendMessage("pong")
                .queue();
            return 1;
            }
        )
    );

try {
    JDA jda = JDABuilder.createDefault("Discord_Bot_Token_Here").build();

    jda.addEventListener(discordBrigadier);

    jda.awaitReady();
} catch(Exception e) {}