Class WebhookService

java.lang.Object
discord4j.rest.service.RestService
discord4j.rest.service.WebhookService

public class WebhookService extends RestService
  • Constructor Details

    • WebhookService

      public WebhookService(Router router)
  • Method Details

    • createWebhook

      public Mono<discord4j.discordjson.json.WebhookData> createWebhook(long channelId, discord4j.discordjson.json.WebhookCreateRequest request, @Nullable String reason)
    • getChannelWebhooks

      public Flux<discord4j.discordjson.json.WebhookData> getChannelWebhooks(long channelId)
    • getGuildWebhooks

      public Flux<discord4j.discordjson.json.WebhookData> getGuildWebhooks(long guildId)
    • getWebhook

      public Mono<discord4j.discordjson.json.WebhookData> getWebhook(long webhookId)
    • getWebhookWithToken

      public Mono<discord4j.discordjson.json.WebhookData> getWebhookWithToken(long webhookId, String token)
    • modifyWebhook

      public Mono<discord4j.discordjson.json.WebhookData> modifyWebhook(long webhookId, discord4j.discordjson.json.WebhookModifyRequest request, @Nullable String reason)
    • modifyWebhookWithToken

      public Mono<discord4j.discordjson.json.WebhookData> modifyWebhookWithToken(long webhookId, String token, discord4j.discordjson.json.WebhookModifyWithTokenRequest request)
    • deleteWebhook

      public Mono<Void> deleteWebhook(long webhookId, @Nullable String reason)
    • deleteWebhookWithToken

      public Mono<Void> deleteWebhookWithToken(long webhookId, String token)
    • executeWebhook

      public Mono<discord4j.discordjson.json.MessageData> executeWebhook(long webhookId, String token, boolean wait, MultipartRequest<? extends discord4j.discordjson.json.WebhookExecuteRequest> request)
      Executes the specified webhook.
      Parameters:
      wait - true if you want to return message data and errors for the webhook.
      Returns:
      If wait is true, a mono that contains the message information of the execution or an error if the webhook is unsuccessful. If wait is false, the mono completes as soon as the request is finished sending, and DOES NOT result in an error if the message is not saved.
    • executeWebhook

      public Mono<discord4j.discordjson.json.MessageData> executeWebhook(long webhookId, String token, boolean wait, boolean withComponents, MultipartRequest<? extends discord4j.discordjson.json.WebhookExecuteRequest> request)
      Executes the specified webhook.
      Parameters:
      wait - true if you want to return message data and errors for the webhook.
      withComponents - true if you want to allow sending (non-interactive) components for non-application-owned webhooks
      Returns:
      If wait is true, a mono that contains the message information of the execution or an error if the webhook is unsuccessful. If wait is false, the mono completes as soon as the request is finished sending, and DOES NOT result in an error if the message is not saved.
    • executeWebhook

      public Mono<discord4j.discordjson.json.MessageData> executeWebhook(long webhookId, String token, boolean wait, long threadId, MultipartRequest<? extends discord4j.discordjson.json.WebhookExecuteRequest> request)
      Executes the specified webhook.
      Parameters:
      wait - true if you want to return message data and errors for the webhook.
      threadId - specify the thread id within a webhook's channel.
      Returns:
      If wait is true, a mono that contains the message information of the execution or an error if the webhook is unsuccessful. If wait is false, the mono completes as soon as the request is finished sending, and DOES NOT result in an error if the message is not saved.
    • executeWebhook

      public Mono<discord4j.discordjson.json.MessageData> executeWebhook(long webhookId, String token, boolean wait, long threadId, boolean withComponents, MultipartRequest<? extends discord4j.discordjson.json.WebhookExecuteRequest> request)
      Executes the specified webhook.
      Parameters:
      wait - true if you want to return message data and errors for the webhook.
      threadId - specify the thread id within a webhook's channel.
      withComponents - true if you want to allow sending (non-interactive) components for non-application-owned webhooks
      Returns:
      If wait is true, a mono that contains the message information of the execution or an error if the webhook is unsuccessful. If wait is false, the mono completes as soon as the request is finished sending, and DOES NOT result in an error if the message is not saved.
    • getWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> getWebhookMessage(long webhookId, String webhookToken, String messageId)
    • getWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> getWebhookMessage(long webhookId, String webhookToken, String messageId, long threadId)
    • modifyWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> modifyWebhookMessage(long webhookId, String webhookToken, String messageId, boolean withComponents, discord4j.discordjson.json.WebhookMessageEditRequest request)
    • modifyWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> modifyWebhookMessage(long webhookId, String webhookToken, String messageId, discord4j.discordjson.json.WebhookMessageEditRequest request)
    • modifyWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> modifyWebhookMessage(long webhookId, String webhookToken, String messageId, long threadId, boolean withComponents, discord4j.discordjson.json.WebhookMessageEditRequest request)
    • modifyWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> modifyWebhookMessage(long webhookId, String webhookToken, String messageId, long threadId, discord4j.discordjson.json.WebhookMessageEditRequest request)
    • modifyWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> modifyWebhookMessage(long webhookId, String webhookToken, String messageId, boolean withComponents, MultipartRequest<discord4j.discordjson.json.WebhookMessageEditRequest> request)
    • modifyWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> modifyWebhookMessage(long webhookId, String webhookToken, String messageId, MultipartRequest<discord4j.discordjson.json.WebhookMessageEditRequest> request)
    • modifyWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> modifyWebhookMessage(long webhookId, String webhookToken, String messageId, long threadId, boolean withComponents, MultipartRequest<discord4j.discordjson.json.WebhookMessageEditRequest> request)
    • modifyWebhookMessage

      public Mono<discord4j.discordjson.json.MessageData> modifyWebhookMessage(long webhookId, String webhookToken, String messageId, long threadId, MultipartRequest<discord4j.discordjson.json.WebhookMessageEditRequest> request)
    • deleteWebhookMessage

      public Mono<Void> deleteWebhookMessage(long webhookId, String webhookToken, String messageId)
    • deleteWebhookMessage

      public Mono<Void> deleteWebhookMessage(long webhookId, String webhookToken, String messageId, long threadId)