Quarkus Discord4J is an experimental Quarkus extension which allows you to develop a WebSocket-based (Gateway) Discord bot using the Discord4J library with minimal boilerplate.
Your bot code will look like this:
class MyDiscordBot {
Mono<Void> onMessageCreate(@GatewayEvent MessageCreateEvent event) {
return event.getMessage().addReaction(ReactionEmoji.of("🤖"));
}
}
The code above listens to the MESSAGE_CREATE
Gateway event and adds a reaction of 🤖 to every received message.
With the additional commands extension, you can also automatically register and listen for application commands.
Because it's a Quarkus extension, all the standard Quarkus goodies apply:
- Quarkus live reload to detect user code changes and restart your bot automatically (and delay incoming events until after your bot restarts to increase developer joy!)
- Native executable generation via GraalVM or Mandrel
- Optional automatic metrics collection
- And more!
Inspired by the Quarkus GitHub App extension.
Please refer to the extension documentation to learn how to get started and more.
Does your Discord bot use this extension? Please open a PR and add it here!
Thanks goes to these wonderful people (emoji key):
cameronprater 💻 🚧 |
Guillaume Smet 💻 |
Julien Ponge 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!