项目作者: Concordia-Modding-Community

项目描述 :
JDA Brigadier Parser Plugin
高级语言: Java
项目地址: git://github.com/Concordia-Modding-Community/b4dis.git
创建时间: 2021-01-11T20:30:15Z
项目社区:https://github.com/Concordia-Modding-Community/b4dis

开源协议:MIT License

下载


b4dis

JDA Brigadier Parser Plugin.

  1. 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

  1. DiscordBrigadier discordBrigadier = new DiscordBrigadier();
  2. discordBrigadier.register(
  3. DiscordBrigadier
  4. .literal("ping")
  5. .executes(context -> {
  6. context
  7. .getSource()
  8. .getTextChannel()
  9. .sendMessage("pong")
  10. .queue();
  11. return 1;
  12. }
  13. )
  14. );
  15. try {
  16. JDA jda = JDABuilder.createDefault("Discord_Bot_Token_Here").build();
  17. jda.addEventListener(discordBrigadier);
  18. jda.awaitReady();
  19. } catch(Exception e) {}