Class WebhookEmbed

  • All Implemented Interfaces:
    org.json.JSONString
    Direct Known Subclasses:
    ReadonlyEmbed

    public class WebhookEmbed
    extends Object
    implements org.json.JSONString
    Reduced version of an ReadonlyEmbed used for sending. A webhook can send up to 10 embeds in a single message.
    See Also:
    WebhookEmbedBuilder
    • Field Detail

      • MAX_FIELDS

        public static final int MAX_FIELDS
        Max amount of fields an embed can hold (25)
        See Also:
        Constant Field Values
    • Method Detail

      • getThumbnailUrl

        @Nullable
        @JSONPropertyIgnore
        public @Nullable String getThumbnailUrl()
        The thumbnail url
        Returns:
        Possibly-null url
      • getImageUrl

        @Nullable
        @JSONPropertyIgnore
        public @Nullable String getImageUrl()
        The image url
        Returns:
        Possibly-null url
      • getTimestamp

        @Nullable
        public @Nullable OffsetDateTime getTimestamp()
        The timestamp for the embed.
        The discord client displays this in the correct timezone and locale of the viewing users.
        Returns:
        Possibly-null OffsetDateTime of the timestamp
      • getColor

        @Nullable
        public @Nullable Integer getColor()
        The rgb color of this embed.
        This is the colored line on the left-hand side of the embed.
        Returns:
        Possibly-null boxed integer of the color
      • getDescription

        @Nullable
        public @Nullable String getDescription()
        The description of this embed
        Returns:
        Possibly-null description
      • getFields

        @NotNull
        public @NotNull List<WebhookEmbed.EmbedField> getFields()
        List of fields for this embed.
        And embed can have up to 25.
        Returns:
        List of fields for this embed
      • reduced

        @NotNull
        public @NotNull WebhookEmbed reduced()
        Returns this embed instance, as its already reduced.
        Returns:
        The current instance
      • toString

        public String toString()
        JSON representation of this embed
        Overrides:
        toString in class Object
        Returns:
        The JSON representation
      • toJSONString

        public String toJSONString()
        Specified by:
        toJSONString in interface org.json.JSONString