Interface WebhookManager

All Superinterfaces:
AuditableRestAction<Void>, Manager<WebhookManager>, RestAction<Void>

public interface WebhookManager extends Manager<WebhookManager>
Manager providing functionality to update one or more fields for a Webhook.

Example

manager.setName("GitHub Webhook")
       .setChannel(channel)
       .queue();
manager.reset(WebhookManager.NAME | WebhookManager.AVATAR)
       .setName("Meme Feed")
       .setAvatar(null)
       .queue();
See Also:
  • Field Details

  • Method Details

    • reset

      @Nonnull @CheckReturnValue WebhookManager reset(long fields)
      Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
      Example: manager.reset(WebhookManager.CHANNEL | WebhookManager.NAME);

      Flag Constants:

      Specified by:
      reset in interface Manager<WebhookManager>
      Parameters:
      fields - Integer value containing the flags to reset.
      Returns:
      WebhookManager for chaining convenience
    • reset

      @Nonnull @CheckReturnValue WebhookManager reset(@Nonnull long... fields)
      Resets the fields specified by the provided bit-flag patterns.
      Example: manager.reset(WebhookManager.CHANNEL, WebhookManager.NAME);

      Flag Constants:

      Specified by:
      reset in interface Manager<WebhookManager>
      Parameters:
      fields - Integer values containing the flags to reset.
      Returns:
      WebhookManager for chaining convenience
    • getWebhook

      @Nonnull Webhook getWebhook()
      The target Webhook that will be modified by this manager
      Returns:
      The target Webhook
    • getChannel

      @Nonnull default IWebhookContainerUnion getChannel()
      The channel that this Manager's Webhook is in.
      This is logically the same as calling getWebhook().getChannel()
      Returns:
      The parent IWebhookContainer instance.
    • getGuild

      @Nonnull default Guild getGuild()
      The Guild this Manager's Webhook is in.
      This is logically the same as calling getWebhook().getGuild()
      Returns:
      The parent Guild
    • setName

      @Nonnull @CheckReturnValue WebhookManager setName(@Nonnull String name)
      Sets the default name of the selected Webhook.

      A webhook name must not be null or blank!

      Parameters:
      name - The new default name for the selected Webhook
      Returns:
      WebhookManager for chaining convenience
      Throws:
      IllegalArgumentException - If the provided name is null or blank
    • setAvatar

      @Nonnull @CheckReturnValue WebhookManager setAvatar(@Nullable Icon icon)
      Sets the default avatar of the selected Webhook.
      Parameters:
      icon - The new default avatar Icon for the selected Webhook or null to reset
      Returns:
      WebhookManager for chaining convenience
    • setChannel

      @Nonnull @CheckReturnValue WebhookManager setChannel(@Nonnull TextChannel channel)
      Sets the TextChannel of the selected Webhook.

      A webhook channel must not be null and must be in the same Guild!

      Parameters:
      channel - The new TextChannel for the selected Webhook
      Returns:
      WebhookManager for chaining convenience
      Throws:
      InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_WEBHOOKS in the specified TextChannel
      IllegalArgumentException - If the provided channel is null or from a different Guild