Class MessageUpdateEvent
java.lang.Object
discord4j.core.event.domain.Event
discord4j.core.event.domain.message.MessageEvent
discord4j.core.event.domain.message.MessageUpdateEvent
Dispatched when a message is updated.
This event includes both normal message editing as well as the following behavior regarding embeds: When a message with a link is sent, it does not initially contain its embed. When Discord creates the embed, this event is fired with it added to the embeds list.
This event is dispatched by Discord.
- See Also:
-
Constructor Summary
ConstructorDescriptionMessageUpdateEvent
(GatewayDiscordClient gateway, ShardInfo shardInfo, long messageId, long channelId, Long guildId, Message old, boolean contentChanged, String currentContent, boolean embedsChanged, List<Embed> currentEmbeds) -
Method Summary
Modifier and TypeMethodDescriptionRequests to retrieve theMessageChannel
containing the updatedMessage
in this event.Gets the current, new, version of theMessage
's content in this event, if present.getGuild()
Requests to retrieve theMessage
that has been updated in this event.getOld()
Gets the old version of the updatedMessage
, if present.boolean
Gets whether or not the content of theMessage
has been changed in this event.boolean
toString()
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
Constructor Details
-
MessageUpdateEvent
-
-
Method Details
-
getMessageId
- Returns:
- THe ID of the
Message
.
-
getMessage
Requests to retrieve theMessage
that has been updated in this event. -
getChannelId
- Returns:
- The ID of the
MessageChannel
containing the updatedMessage
.
-
getChannel
Requests to retrieve theMessageChannel
containing the updatedMessage
in this event.- Returns:
- A
Mono
where, upon successful completion, emits theMessageChannel
containing theMessage
. If an error is received, it is emitted through theMono
.
-
getGuildId
-
getGuild
-
getOld
Gets the old version of the updatedMessage
, if present. This may not be available ifMessages
are not stored.- Returns:
- The old version of the updated
Message
, if present.
-
isContentChanged
public boolean isContentChanged()Gets whether or not the content of theMessage
has been changed in this event.- Returns:
- Whether or not the content of the
Message
has been changed.
-
getCurrentContent
Gets the current, new, version of theMessage
's content in this event, if present.- Returns:
- The current version of the
Message
's content, if present.
-
isEmbedsChanged
public boolean isEmbedsChanged() -
getCurrentEmbeds
-
toString
-