Class WebhookConnector

java.lang.Object
org.tywrapstudios.ctd.discord.webhook.WebhookConnector

public class WebhookConnector extends Object
  • Constructor Details

    • WebhookConnector

      public WebhookConnector()
  • Method Details

    • setChannelUrl

      public WebhookConnector setChannelUrl(String webhookUrl)
      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

      public WebhookConnector setMessage(PlainMessage message)
      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

      public WebhookConnector setListener(WebhookClient.Callback callback)
      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

      public Embed[] getEmbeds()
    • setEmbeds

      public WebhookConnector setEmbeds(Embed[] embeds)
      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

      public WebhookConnector exec()
      Executes the sending of the message to the specified webhook.
      Returns:
      An instance of WebhookManager.