Interface MessageBasedContext

All Superinterfaces:
AccessContext, AccessValidator, ChannelAccessContext, ChannelAccessValidator, ChannelEventContext, EventContext
All Known Subinterfaces:
ButtonEventContext, ComponentEventContext, MessageCreateEventContext, MessageEventContext, MessageIncludedContext, ModalEventContext

public interface MessageBasedContext extends ChannelEventContext
The context of an event that is related to a message.
Since:
1.0
Version:
1.0
  • Method Details

    • fetchMessage

      @SideEffectFree Mono<Message> fetchMessage()
      Retrieves the message that the event originates from.
      Returns:
      The message, or an empty mono if the message cannot be retrieved.
      See Also:
      Implementation Requirements:
      Unlike message(), this method may fetch the message again rather than using the message included in the event, if there is one.
    • message

      Retrieves the message that the event originates from, as attached to the event.
      Returns:
      The message, or null if the message data is not attached to the received event.
      See Also:
      Implementation Requirements:
      This method always returns the message that was included in the event.
    • messageId

      @Pure Snowflake messageId()
      Retrieves the ID of the message that the event originates from.
      Returns:
      The message ID.
    • channel

      Mono<? extends MessageChannel> channel()
      Description copied from interface: ChannelAccessContext
      Retrieves the channel.
      Specified by:
      channel in interface ChannelAccessContext
      Returns:
      The channel.