Class SocialMessageContext

java.lang.Object
ovh.mythmc.social.api.context.SocialMessageContext
All Implemented Interfaces:
SocialContext
Direct Known Subclasses:
SocialRegisteredMessageContext

public class SocialMessageContext extends Object implements SocialContext
Represents the context of a message sent through the social chat system.

A SocialMessageContext contains all relevant information about a message at the time it is processed, including:

  • The SocialUser who sent the message
  • The ChatChannel the message was sent in
  • The set of viewers who can receive the message
  • The raw, unformatted message content
  • An optional reply message ID
  • An optional SignedMessage
See Also:
  • Constructor Details

    • SocialMessageContext

      public SocialMessageContext()
  • Method Details

    • signedMessage

      public Optional<SignedMessage> signedMessage()
      Returns the signed message, if present.
      Returns:
      an Optional containing the SignedMessage if available, otherwise an empty Optional
    • isReply

      public boolean isReply()
      Determines whether this message is a valid reply to another message.

      A message is considered a reply if:

      • replyId is not null, and
      • A message with that ID exists in the chat history
      Returns:
      true if this message references an existing message, false otherwise