Class SocialRegisteredMessageContext

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

public class SocialRegisteredMessageContext extends SocialMessageContext
Represents a registered and persisted social message.

SocialRegisteredMessageContext extends SocialMessageContext and adds metadata that becomes available once a message has been stored in the chat history system.

In addition to the base message context, this class provides:

  • A unique message identifier
  • The fully processed Component message
  • The message creation timestamp

Instances of this class typically represent messages that have been registered in the chat history and can therefore be referenced (e.g. replies).

See Also:
  • Constructor Details

    • SocialRegisteredMessageContext

      public SocialRegisteredMessageContext(int id, long timestamp, SocialUser sender, ChatChannel channel, Set<Audience> viewers, Component message, String rawMessage, Integer replyId, SignedMessage signedMessage)
      Constructs a new registered message context.
      Parameters:
      id - the unique message ID
      timestamp - the creation timestamp in milliseconds since epoch
      sender - the message sender
      channel - the channel the message was sent in
      viewers - the audiences who received the message
      message - the processed message component
      rawMessage - the raw, unprocessed message content
      replyId - the ID of the replied message, or null
      signedMessage - the signed message payload, or null
  • Method Details

    • date

      public String date()
      Formats the message timestamp into a human-readable date string.

      The format pattern is retrieved from the configuration: Social.get().getConfig().getGeneral().getDateFormat().

      Returns:
      the formatted date string