Skip to content

Concordia-Modding-Community/b4dis

Repository files navigation

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) {}

Releases

No releases published

Packages

No packages published

Languages