Class MessageDeleteEvent


public class MessageDeleteEvent extends MessageEvent
Dispatched when a message is deleted.

The deleted message may not be present if messages are not stored.

This event is dispatched by Discord.

See Also:
  • Constructor Details

  • Method Details

    • getMessageId

      public Snowflake getMessageId()
      Gets the Snowflake ID of the Message that was deleted.
      Returns:
      The ID of the deleted Message.
    • getMessage

      public Optional<Message> getMessage()
      Gets the Message that was deleted in this event, if present. This may not be available if Messages are not stored.
      Returns:
      The deleted Message, if present.
    • getChannelId

      public Snowflake getChannelId()
      Gets the Snowflake ID of the MessageChannel the Message was deleted from.
      Returns:
      The ID of the MessageChannel that the Message was deleted from.
    • getChannel

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

      public Optional<Snowflake> getGuildId()
      Gets the Snowflake ID of the Guild the Message was deleted from, if present. This may not be available if the deleted Message was from a private channel.
      Returns:
      The ID of the Guild involved, if present.
    • getGuild

      public Mono<Guild> getGuild()
      Requests to retrieve the Guild the Message was deleted from, if present. This may not be available if the deleted Message was from a private channel.
      Returns:
      A Mono where, upon successful completion, emits the Guild that contained the Message involved, if present. If an error is received, it is emitted through the Mono.
    • toString

      public String toString()
      Overrides:
      toString in class Object