Closed ghostbear closed 1 year ago
The current way of handling events with the event handler is far from perfect.
The idea is to create a more Spring type of working with Discord4J would be to create a few annotations that would allow us to define event handlers.
@EventHandlerComponent public class MyEventHandler { @SlashCommandHandler(command = "parent.subcommand") public Mono<Void> mySubcommandHandler(ChatInputInteractionEvent event) {} @EventHandler(for = ModalSubmitInteractionEvent.class, customId = "myCustomId") public Mono<Void> myModalHandler(ModalSubmitInteractionEvent event) {} @EventHandler(for = ModalSubmitInteractionEvent.class) public Publisher<?> myMessageCreateHandler(MessageCreateEvent event) }
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/config/BeanPostProcessor.html
The current way of handling events with the event handler is far from perfect.
The idea is to create a more Spring type of working with Discord4J would be to create a few annotations that would allow us to define event handlers.
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/config/BeanPostProcessor.html