Class 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:
  • Constructor Details

  • Method Details

    • getMessageId

      public Snowflake getMessageId()
      Gets the Snowflake ID of the Message that has been updated in this event.
      Returns:
      THe ID of the Message.
    • getMessage

      public Mono<Message> getMessage()
      Requests to retrieve the Message that has been updated in this event.
      Returns:
      A Mono where, upon successful completion, emits the Message that was updated. If an error is received, it is emitted through the Mono.
    • getChannelId

      public Snowflake getChannelId()
      Gets the Snowflake ID of the MessageChannel containing the updated Message.
      Returns:
      The ID of the MessageChannel containing the updated Message.
    • getChannel

      public Mono<MessageChannel> getChannel()
      Requests to retrieve the MessageChannel containing the updated Message in this event.
      Returns:
      A Mono where, upon successful completion, emits the MessageChannel containing the Message. If an error is received, it is emitted through the Mono.
    • getGuildId

      public Optional<Snowflake> getGuildId()
      The Snowflake ID of the Guild containing the updated Message in this event, if present.
      Returns:
      The ID of the Guild containing the updated Message, if present.
    • getGuild

      public Mono<Guild> getGuild()
      Request to retrieve the Guild containing the updated Message in this event.
      Returns:
      A Mono where, upon successful completion, emits the Guild containing the updated Message. If an error is received, it is emitted through the Mono.
    • getOld

      public Optional<Message> getOld()
      Gets the old version of the updated Message, if present. This may not be available if Messages are not stored.
      Returns:
      The old version of the updated Message, if present.
    • isContentChanged

      public boolean isContentChanged()
      Gets whether or not the content of the Message 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 the Message's content in this event, if present.
      Returns:
      The current version of the Message's content, if present.
    • isEmbedsChanged

      public boolean isEmbedsChanged()
      Gets whether or not the Embed in the Message has been changed in this event.
      Returns:
      Whether or not the Embed in the Message has been changed.
    • getCurrentEmbeds

      public List<Embed> getCurrentEmbeds()
      Gets the current, new, version of the Message's Embed in this event.
      Returns:
      The current version of the Message's Embed.
    • toString

      public String toString()
      Overrides:
      toString in class Object