Class SocialMessagePrepare
java.lang.Object
ovh.mythmc.social.api.callback.message.SocialMessagePrepare
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
SocialUserwho sent the original message. - channel: The
ChatChannelthe message will be sent to. - viewers: A
SetofAudiencewho will receive the message. - plainMessage: The original, unformatted
Stringmessage content. - replyId: The identifier of the message being replied to, or
nullif this is not a reply. - cancelled: Whether this event has been cancelled, preventing the message from being sent.
-
Constructor Summary
ConstructorsConstructorDescriptionSocialMessagePrepare(SocialUser sender, ChatChannel channel, Set<Audience> viewers, String plainMessage, Integer replyId) Constructs a newSocialMessagePrepareevent with the given sender, channel, viewers, message, and optional reply ID. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisReply()Determines if the current message is a reply to another message.
-
Constructor Details
-
SocialMessagePrepare
public SocialMessagePrepare(SocialUser sender, ChatChannel channel, Set<Audience> viewers, String plainMessage, Integer replyId) Constructs a newSocialMessagePrepareevent with the given sender, channel, viewers, message, and optional reply ID.- Parameters:
sender- theSocialUserwho is sending the messagechannel- theChatChannelthe message will be sent toviewers- theSetofAudiencethat will receive the messageplainMessage- the original unformatted message contentreplyId- the ID of the message being replied to, ornullif there is no reply
-
-
Method Details
-
isReply
public boolean isReply()Determines if the current message is a reply to another message.- Returns:
trueif this message is a reply, otherwisefalse
-