Class WebhookEmbedBuilder

    • Constructor Detail

      • WebhookEmbedBuilder

        public WebhookEmbedBuilder()
        Creates an empty builder
      • WebhookEmbedBuilder

        public WebhookEmbedBuilder​(@Nullable
                                   @Nullable WebhookEmbed embed)
        Creates a builder with predefined settings from the provided WebhookEmbed instance
        Parameters:
        embed - The (nullable) embed to copy
    • Method Detail

      • reset

        public void reset()
        Resets the builder to its default state
      • setColor

        @NotNull
        public @NotNull WebhookEmbedBuilder setColor​(@Nullable
                                                     @Nullable Integer color)
        The rgb color to use for the line left to the resulting embed
        Parameters:
        color - The (nullable) color to use
        Returns:
        The current builder for chaining convenience
      • setDescription

        @NotNull
        public @NotNull WebhookEmbedBuilder setDescription​(@Nullable
                                                           @Nullable String description)
        The description of the embed, this is the default text used in most embeds. It is displayed below author and title and above fields and image.
        Parameters:
        description - The (nullable) description to use
        Returns:
        The current builder for chaining convenience
      • setThumbnailUrl

        @NotNull
        public @NotNull WebhookEmbedBuilder setThumbnailUrl​(@Nullable
                                                            @Nullable String thumbnailUrl)
        The thumbnail url for this embed.
        This is displayed as small image to the right side of the description.
        Parameters:
        thumbnailUrl - The (nullable) thumbnail url
        Returns:
        The current builder for chaining convenience
      • setImageUrl

        @NotNull
        public @NotNull WebhookEmbedBuilder setImageUrl​(@Nullable
                                                        @Nullable String imageUrl)
        The image url for this embed.
        This is displayed below the description.
        Parameters:
        imageUrl - The (nullable) image url
        Returns:
        The current builder for chaining convenience
      • isEmpty

        public boolean isEmpty()
        Whether this embed is currently empty.
        Returns:
        True, if this embed is empty
      • fromJDA

        @NotNull
        public static @NotNull WebhookEmbedBuilder fromJDA​(@NotNull
                                                           net.dv8tion.jda.api.entities.MessageEmbed embed)
        Converts a JDA MessageEmbed into a compatible WebhookEmbedBuilder.
        Parameters:
        embed - The embed
        Returns:
        WebhookEmbedBuilder with the converted data
        Throws:
        NullPointerException - If null is provided
      • fromJavacord

        @NotNull
        public static @NotNull WebhookEmbedBuilder fromJavacord​(@NotNull
                                                                org.javacord.api.entity.message.embed.Embed embed)
        Converts a Javacord Embed into a compatible WebhookEmbedBuilder.
        Parameters:
        embed - The embed
        Returns:
        WebhookEmbedBuilder with the converted data
        Throws:
        NullPointerException - If null is provided
      • fromD4J

        @NotNull
        @Deprecated
        public static @NotNull WebhookEmbedBuilder fromD4J​(@NotNull
                                                           @NotNull Consumer<? super discord4j.core.spec.EmbedCreateSpec> callback)
        Deprecated.
        Converts a Discord4J EmbedCreateSpec into a compatible WebhookEmbedBuilder.
        Parameters:
        callback - The callback which applies the desired settings to the EmbedCreateSpec
        Returns:
        WebhookEmbedBuilder with the converted data
        Throws:
        NullPointerException - If null is provided
      • fromD4J

        @NotNull
        public static @NotNull WebhookEmbedBuilder fromD4J​(@NotNull
                                                           @NotNull discord4j.core.spec.EmbedCreateSpec spec)
        Converts a Discord4J EmbedCreateSpec into a compatible WebhookEmbedBuilder.
        Parameters:
        spec - The embed create spec which applies the desired settings
        Returns:
        WebhookEmbedBuilder with the converted data
        Throws:
        NullPointerException - If null is provided
      • fromD4J

        @NotNull
        public static @NotNull WebhookEmbedBuilder fromD4J​(@NotNull
                                                           @NotNull discord4j.discordjson.json.EmbedData data)
        Converts a Discord4J EmbedData into a compatible WebhookEmbedBuilder.
        Parameters:
        data - The embed data
        Returns:
        WebhookEmbedBuilder with the converted data
        Throws:
        NullPointerException - If null is provided