Class MessageCreateEvent


  • public class MessageCreateEvent
    extends MessageEvent
    Dispatched when a message is sent in a message channel.

    guildId and member may not be present if the message was sent in a private channel.

    This event is dispatched by Discord.

    See Also:
    Message Create
    • Method Detail

      • getMessage

        public Message getMessage()
        Gets the Message that was created in this event.
        Returns:
        The Message that was created.
      • getGuildId

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

        public Mono<Guild> getGuild()
        Requests to retrieve the Guild the Message was created in, if present. This may not be available if the Message was sent in a private channel.
        Returns:
        A Mono where, upon successful completion, emits the Guild the message was created in, if present. If an error is received, it is emitted through the Mono.
      • getMember

        public Optional<Member> getMember()
        Gets the Member who has sent the Message created in this event, if present. This may not be available if the Message was sent in a private channel.
        Returns:
        The Member who has sent the Message created in this event, if present.