Class MessageUpdateEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.message.MessageEvent
-
- discord4j.core.event.domain.message.MessageUpdateEvent
-
public class MessageUpdateEvent extends MessageEvent
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:
- Message Update
-
-
Constructor Summary
Constructors Constructor Description MessageUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, long messageId, long channelId, Long guildId, Message old, boolean contentChanged, String currentContent, boolean embedsChanged, List<Embed> currentEmbeds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<MessageChannel>
getChannel()
Requests to retrieve theMessageChannel
containing the updatedMessage
in this event.Snowflake
getChannelId()
Optional<String>
getCurrentContent()
Gets the current, new, version of theMessage
's content in this event, if present.List<Embed>
getCurrentEmbeds()
Mono<Guild>
getGuild()
Optional<Snowflake>
getGuildId()
Mono<Message>
getMessage()
Requests to retrieve theMessage
that has been updated in this event.Snowflake
getMessageId()
Optional<Message>
getOld()
Gets the old version of the updatedMessage
, if present.boolean
isContentChanged()
Gets whether or not the content of theMessage
has been changed in this event.boolean
isEmbedsChanged()
String
toString()
-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Method Detail
-
getMessage
public Mono<Message> getMessage()
Requests to retrieve theMessage
that has been updated in this event.
-
getChannelId
public Snowflake getChannelId()
- Returns:
- The ID of the
MessageChannel
containing the updatedMessage
.
-
getChannel
public Mono<MessageChannel> 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
.
-
getOld
public Optional<Message> 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
public Optional<String> 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()
-
-