Class MessageReceivedEvent

All Implemented Interfaces:

public class MessageReceivedEvent extends GenericMessageEvent
Indicates that a Message was received in a MessageChannel.
This includes TextChannel and PrivateChannel!

Can be used to detect that a Message is received in either a guild- or private channel. Providing a MessageChannel and Message.


This event requires at least one of the following intents (Will not fire at all if neither is enabled):

  • Constructor Details

  • Method Details

    • getMessage

      @Nonnull public Message getMessage()
      The received Message object.
      The received Message object.
    • getAuthor

      @Nonnull public User getAuthor()
      The Author of the Message received as User object.
      This will be never-null but might be a fake user if Message was sent via Webhook (Guild only). See Webhook.getDefaultUser().
      The Author of the Message.
      See Also:
    • getMember

      @Nullable public Member getMember()
      The Author of the Message received as Member object.
      This will be null in case of Message being received in a PrivateChannel or isWebhookMessage() returning true.
      The Author of the Message as null-able Member object.
      See Also:
    • isWebhookMessage

      public boolean isWebhookMessage()
      Whether or not the Message received was sent via a Webhook.
      This is a shortcut for getMessage().isWebhookMessage().
      True, if the Message was sent via Webhook