Class WebhookClientBuilder

    • Field Detail

      • WEBHOOK_PATTERN

        public static final Pattern WEBHOOK_PATTERN
        Pattern used to validate webhook urls (?:https?://)?(?:\w+\.)?discord(?:app)?\.com/api(?:/v\d+)?/webhooks/(\d+)/([\w-]+)(?:/(?:\w+)?)?
    • Constructor Detail

      • WebhookClientBuilder

        public WebhookClientBuilder​(long id,
                                    @NotNull
                                    @NotNull String token)
        Creates a new WebhookClientBuilder for the specified webhook components
        Parameters:
        id - The webhook id
        token - The webhook token
        Throws:
        NullPointerException - If the token is null
      • WebhookClientBuilder

        public WebhookClientBuilder​(@NotNull
                                    @NotNull String url)
        Creates a new WebhookClientBuilder for the specified webhook url
        The url is verified using WEBHOOK_PATTERN.
        Parameters:
        url - The url to use
        Throws:
        NullPointerException - If the url is null
        IllegalArgumentException - If the url is not valid