Class WebhookBuilder



  • public class WebhookBuilder
    extends Object
    This class can be used to create webhooks.
    • Constructor Detail

      • WebhookBuilder

        public WebhookBuilder​(ServerTextChannel channel)
        Creates a new webhook builder.
        Parameters:
        channel - The server text channel of the webhook.
    • Method Detail

      • setAuditLogReason

        public WebhookBuilder setAuditLogReason​(String reason)
        Sets the reason for this update. This reason will be visible in the audit log entry(s).
        Parameters:
        reason - The reason for this update.
        Returns:
        The current instance in order to chain call methods.
      • setName

        public WebhookBuilder setName​(String name)
        Sets the name.
        Parameters:
        name - The new name of the webhook.
        Returns:
        The current instance in order to chain call methods.
      • setAvatar

        public WebhookBuilder setAvatar​(BufferedImage avatar)
        Sets the avatar. This method assumes the file type is "png"!
        Parameters:
        avatar - The avatar to set.
        Returns:
        The current instance in order to chain call methods.
      • setAvatar

        public WebhookBuilder setAvatar​(BufferedImage avatar,
                                        String fileType)
        Sets the avatar.
        Parameters:
        avatar - The avatar to set.
        fileType - The type of the avatar, e.g. "png" or "jpg".
        Returns:
        The current instance in order to chain call methods.
      • setAvatar

        public WebhookBuilder setAvatar​(File avatar)
        Sets the avatar.
        Parameters:
        avatar - The avatar to set.
        Returns:
        The current instance in order to chain call methods.
      • setAvatar

        public WebhookBuilder setAvatar​(Icon avatar)
        Sets the avatar.
        Parameters:
        avatar - The avatar to set.
        Returns:
        The current instance in order to chain call methods.
      • setAvatar

        public WebhookBuilder setAvatar​(URL avatar)
        Sets the avatar.
        Parameters:
        avatar - The avatar to set.
        Returns:
        The current instance in order to chain call methods.
      • setAvatar

        public WebhookBuilder setAvatar​(byte[] avatar)
        Sets the avatar. This method assumes the file type is "png"!
        Parameters:
        avatar - The avatar to set.
        Returns:
        The current instance in order to chain call methods.
      • setAvatar

        public WebhookBuilder setAvatar​(byte[] avatar,
                                        String fileType)
        Sets the avatar.
        Parameters:
        avatar - The avatar to set.
        fileType - The type of the avatar, e.g. "png" or "jpg".
        Returns:
        The current instance in order to chain call methods.
      • setAvatar

        public WebhookBuilder setAvatar​(InputStream avatar)
        Sets the avatar. This method assumes the file type is "png"!
        Parameters:
        avatar - The avatar to set.
        Returns:
        The current instance in order to chain call methods.
      • setAvatar

        public WebhookBuilder setAvatar​(InputStream avatar,
                                        String fileType)
        Sets the avatar.
        Parameters:
        avatar - The avatar to set.
        fileType - The type of the avatar, e.g. "png" or "jpg".
        Returns:
        The current instance in order to chain call methods.