Package net.dv8tion.jda.api.events
Class Event
- java.lang.Object
-
- net.dv8tion.jda.api.events.Event
-
- All Implemented Interfaces:
GenericEvent
- Direct Known Subclasses:
DisconnectEvent
,ExceptionEvent
,GatewayPingEvent
,GenericApplicationCommandEvent
,GenericCategoryEvent
,GenericEmoteEvent
,GenericGuildEvent
,GenericInteractionCreateEvent
,GenericMessageEvent
,GenericPrivateMessageEvent
,GenericRoleEvent
,GenericSelfUpdateEvent
,GenericStoreChannelEvent
,GenericTextChannelEvent
,GenericUserEvent
,GenericVoiceChannelEvent
,GuildTimeoutEvent
,HttpRequestEvent
,MessageBulkDeleteEvent
,PrivateChannelCreateEvent
,PrivateChannelDeleteEvent
,RawGatewayEvent
,ReadyEvent
,ReconnectedEvent
,ResumedEvent
,ShutdownEvent
,StatusChangeEvent
,UnavailableGuildJoinedEvent
,UnavailableGuildLeaveEvent
public abstract class Event extends java.lang.Object implements GenericEvent
Top-level event type
All events JDA fires are derived from this class.Can be used to check if an Object is a JDA event in
EventListener
implementations to distinguish what event is being fired.
Adapter implementation:ListenerAdapter
-
-
Constructor Summary
Constructors Constructor Description Event(JDA api)
Creates a new Event from the given JDA instance
Uses the currentJDA.getResponseTotal()
as sequenceEvent(JDA api, long responseNumber)
Creates a new Event from the given JDA instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JDA
getJDA()
The current JDA instance corresponding to this Eventlong
getResponseNumber()
The current sequence for this event.
-
-
-
Constructor Detail
-
Event
public Event(@Nonnull JDA api, long responseNumber)
Creates a new Event from the given JDA instance- Parameters:
api
- Current JDA instanceresponseNumber
- The sequence number for this event- See Also:
Event(net.dv8tion.jda.api.JDA)
-
Event
public Event(@Nonnull JDA api)
Creates a new Event from the given JDA instance
Uses the currentJDA.getResponseTotal()
as sequence- Parameters:
api
- Current JDA instance
-
-
Method Detail
-
getJDA
@Nonnull public JDA getJDA()
Description copied from interface:GenericEvent
The current JDA instance corresponding to this Event- Specified by:
getJDA
in interfaceGenericEvent
- Returns:
- The corresponding JDA instance
-
getResponseNumber
public long getResponseNumber()
Description copied from interface:GenericEvent
The current sequence for this event.
This can be used to keep events in order when making sequencing system.- Specified by:
getResponseNumber
in interfaceGenericEvent
- Returns:
- The current sequence number for this event
-
-