Interface EventListener

All Known Implementing Classes:
ListenerAdapter
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface EventListener
JDA pushes GenericEvents to the registered EventListeners.

Register an EventListener with either a JDA object
or the JDABuilder.

Examples:
JDA jda = JDABuilder.createDefault("token").addEventListeners(listeners).build();
jda.addEventListener(listeners);

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Handles any GenericEvent.
  • Method Details

    • onEvent

      void onEvent(@Nonnull GenericEvent event)
      Handles any GenericEvent.

      To get specific events with Methods like onMessageReceived(MessageReceivedEvent event) take a look at: ListenerAdapter

      Parameters:
      event - The Event to handle.