Class WebHookMessage
java.lang.Object
net.joseplay.allianceutils.api.discord.webhook.WebHookMessage
Represents a Discord webhook message payload.
Supports content, embeds, username override, and message flags.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEmbed(WebHookEmbed embed) Adds an embed to the message.setAvatarUrl(String avatarUrl) Overrides the webhook avatar.setContent(String content) Sets the plain text content of the message.setUsername(String username) Overrides the webhook username.Suppresses notifications for this message.toJson()Converts this message into JSON format for webhook sending.
-
Constructor Details
-
WebHookMessage
public WebHookMessage()
-
-
Method Details
-
setContent
Sets the plain text content of the message.- Parameters:
content- Message content
-
setUsername
Overrides the webhook username.- Parameters:
username- Custom username
-
setAvatarUrl
Overrides the webhook avatar.- Parameters:
avatarUrl- Avatar image URL
-
addEmbed
Adds an embed to the message.- Parameters:
embed- Embed instance
-
suppressNotifications
Suppresses notifications for this message. Uses Discord flag 4096. -
toJson
Converts this message into JSON format for webhook sending.- Returns:
- JSON payload string
-