Package ovh.mythmc.social.api.context
Class SocialMessageContext
java.lang.Object
ovh.mythmc.social.api.context.SocialMessageContext
- All Implemented Interfaces:
SocialContext
- Direct Known Subclasses:
SocialRegisteredMessageContext
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
SocialUserwho sent the message - The
ChatChannelthe message was sent in - The set of
viewerswho can receive the message - The raw, unformatted message content
- An optional reply message ID
- An optional
SignedMessage
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisReply()Determines whether this message is a valid reply to another message.Returns the signed message, if present.
-
Constructor Details
-
SocialMessageContext
public SocialMessageContext()
-
-
Method Details
-
signedMessage
Returns the signed message, if present.- Returns:
- an
Optionalcontaining theSignedMessageif available, otherwise an emptyOptional
-
isReply
public boolean isReply()Determines whether this message is a valid reply to another message.A message is considered a reply if:
replyIdis notnull, and- A message with that ID exists in the chat history
- Returns:
trueif this message references an existing message,falseotherwise
-