Class WebhookConnector
java.lang.Object
org.tywrapstudios.ctd.discord.webhook.WebhookConnector
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexec()Executes the sending of the message to the specified webhook.Embed[]setChannelUrl(String webhookUrl) Sets the webhook URL for a channel.Sets the array of embeds for the webhook message.setListener(WebhookClient.Callback callback) Sets a listener for webhook response callbacks.setMessage(PlainMessage message) Sets the message content and other details.
-
Constructor Details
-
WebhookConnector
public WebhookConnector()
-
-
Method Details
-
setChannelUrl
Sets the webhook URL for a channel.- Parameters:
webhookUrl- The webhook URL to be set for the channel.- Returns:
- An instance of WebhookManager with the updated webhook URL if the provided URL is valid.
-
setMessage
Sets the message content and other details.- Parameters:
message- The message object containing username, avatar URL, and content.- Returns:
- An instance of WebhookManager with the updated message details.
-
setListener
Sets a listener for webhook response callbacks.- Parameters:
callback- The callback to be invoked upon successful or failed webhook execution.- Returns:
- An instance of WebhookManager with the updated callback listener.
-
getEmbeds
-
setEmbeds
Sets the array of embeds for the webhook message.- Parameters:
embeds- The array of embeds to be attached to the message.- Returns:
- An instance of WebhookManager with the updated array of embeds.
-
exec
Executes the sending of the message to the specified webhook.- Returns:
- An instance of WebhookManager.
-