Package discord4j.core.event.domain
Class Event
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- Direct Known Subclasses:
ApplicationCommandCreateEvent,ApplicationCommandEvent,ChannelEvent,GatewayLifecycleEvent,GuildEvent,IntegrationCreateEvent,IntegrationDeleteEvent,IntegrationUpdateEvent,InteractionCreateEvent,InviteCreateEvent,InviteDeleteEvent,MessageEvent,PresenceUpdateEvent,RoleEvent,UserUpdateEvent,VoiceServerUpdateEvent,VoiceStateUpdateEvent,WebhooksUpdateEvent
public abstract class Event extends Object
Represents a Discord real-time event used to track a client's state.Gateway lifecycle events
These events are specifically sent by Discord as real-time payload.
ReadyEvent: Discord has established a fresh Gateway sessionResumeEvent: specifically sent after successful resumption
Message related events
MessageCreateEvent: a guild or DM message was createdMessageDeleteEvent: a message was deletedMessageUpdateEvent: a message's content was updatedMessageBulkDeleteEvent: a batch of messages were deleted at onceReactionAddEvent: a reaction was added to a messageReactionRemoveEvent: a reaction was removed from a messageReactionRemoveEmojiEvent: reactions for a given emoji were removed from a messageReactionRemoveAllEvent: all reactions were removed from a message
Interaction related events
ChatInputInteractionEvent: user interacted with a slash commandMessageInteractionEvent: user interacted with a message context menuUserInteractionEvent: user interacted with a user context menuApplicationCommandInteractionEvent: user interacted with an application commandSelectMenuInteractionEvent: user interacted with a select menu componentButtonInteractionEvent: user interacted with a button componentComponentInteractionEvent: user interacted with a componentInteractionCreateEvent: base for all Gateway interaction events
Guild related events
GuildCreateEvent: a startup event providing initialGuilddetails, content depends onIntentconfigurationGuildDeleteEvent: after being kicked from a guild, after leaving a guild or after a guild becoming unavailable due to outageGuildUpdateEvent: a guild has changed one or more propertiesMemberJoinEvent: a user has joined a guildMemberLeaveEvent: a user has left or was kicked from a guildMemberUpdateEvent: a user had their nickname and/or roles changeMemberChunkEvent: a batch of a guild's member detailsEmojisUpdateEvent: a guild's emoji list was updatedBanEvent: a user was banned from a guildUnbanEvent: a user's ban was removed from a guildIntegrationsUpdateEvent: a guild has updated their app integrationsWebhooksUpdateEvent: a guild's webhooks were updated
Channel related events
- Channel creation events:
TextChannelCreateEvent,VoiceChannelCreateEvent,CategoryCreateEvent,NewsChannelCreateEvent,StoreChannelCreateEvent - Channel deletion events:
TextChannelDeleteEvent,VoiceChannelDeleteEvent,CategoryDeleteEvent,NewsChannelDeleteEvent,StoreChannelDeleteEvent - Channel update events:
TextChannelUpdateEvent,VoiceChannelUpdateEvent,CategoryUpdateEvent,NewsChannelUpdateEvent,StoreChannelUpdateEvent TypingStartEvent: as a user has started typing a messagePinsUpdateEvent: a channel's pinned messages were updated
Role related events
RoleCreateEvent: a role was created in a guildRoleDeleteEvent: a role was deleted from a guildRoleUpdateEvent: one or more role's properties were updated in a guild
Invite related events
InviteCreateEvent: an invite to a channel was createdInviteDeleteEvent: an invite to a channel has expired
User related events
UserUpdateEvent: one or more user's properties were updatedPresenceUpdateEvent: a user's presence or status has changed
Voice connections related events
VoiceStateUpdateEvent: a user's connected voice channel and status, was requested or has updatedVoiceServerUpdateEvent: a guild's voice server was requested or has updated
Connection lifecycle events
These events are derived by Discord4J according to the status of the websocket lifecycle.
ConnectEvent: connected to the Gateway for the first time onlyReconnectEvent: subsequent reconnections to the Gateway, either through resumption or full retryDisconnectEvent: disconnected from the GatewayReconnectStartEvent: a resumption or reconnection attempt has begunReconnectFailEvent: a resumption or reconnection attempt has failed but can be retriedSessionInvalidatedEvent: a gateway session has been invalidated
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEvent(GatewayDiscordClient gateway, ShardInfo shardInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GatewayDiscordClientgetClient()Get theGatewayDiscordClientthat emitted thisEvent.ShardInfogetShardInfo()Retrieve the shard details from thisEvent.
-
-
-
Constructor Detail
-
Event
protected Event(GatewayDiscordClient gateway, ShardInfo shardInfo)
-
-
Method Detail
-
getClient
public GatewayDiscordClient getClient()
Get theGatewayDiscordClientthat emitted thisEvent.- Returns:
- The client emitting this event.
-
-