Class SocialMessagePrepare

java.lang.Object
ovh.mythmc.social.api.callback.message.SocialMessagePrepare

public final class SocialMessagePrepare extends Object
Event fired before a message is sent, allowing modification or cancellation.

This event provides details about the message, the sender, the channel, and the viewers. It allows for modifications or cancellation of the message before it is sent.

Fields:

  • sender: The SocialUser who sent the original message.
  • channel: The ChatChannel the message will be sent to.
  • viewers: A Set of Audience who will receive the message.
  • plainMessage: The original, unformatted String message content.
  • replyId: The identifier of the message being replied to, or null if this is not a reply.
  • cancelled: Whether this event has been cancelled, preventing the message from being sent.
  • Constructor Details

    • SocialMessagePrepare

      public SocialMessagePrepare(SocialUser sender, ChatChannel channel, Set<Audience> viewers, String plainMessage, Integer replyId)
      Constructs a new SocialMessagePrepare event with the given sender, channel, viewers, message, and optional reply ID.
      Parameters:
      sender - the SocialUser who is sending the message
      channel - the ChatChannel the message will be sent to
      viewers - the Set of Audience that will receive the message
      plainMessage - the original unformatted message content
      replyId - the ID of the message being replied to, or null if there is no reply
  • Method Details

    • isReply

      public boolean isReply()
      Determines if the current message is a reply to another message.
      Returns:
      true if this message is a reply, otherwise false