Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/harmony/src/structures/embed.ts>Embed

An easy to use Discord API Library for Deno.
Go to Latest
class Embed
import { Embed } from "https://deno.land/x/harmony@v2.8.0/src/structures/embed.ts";

Message Embed Object

Constructors

new
Embed(data?: EmbedPayload)

Properties

optional
author: EmbedAuthor
optional
color: number
optional
description: string
optional
fields: EmbedField[]
optional
image: EmbedImage
optional
provider: EmbedProvider
optional
thumbnail: EmbedThumbnail
optional
timestamp: string
optional
title: string
optional
type: EmbedTypes
optional
url: string
optional
video: EmbedVideo

Methods

Adds a Field to the Embed

addField(
name: string,
value: string,
inline?: boolean,
): Embed
addFields(...fields: EmbedField[]): Embed

Adds multiple fields to the Embed

Set Author of the Embed

setAuthor(name: string, image?: string): Embed
setColor(hexInt: number): Embed

Set Color of the Embed

setColor(
r: number,
g: number,
b: number,
): Embed
setColor(random: "random"): Embed
setColor(hexStr: string): Embed
setColor(namedColor: keyof Colors): Embed
setDescription(description: string): Embed

Set Embed description

setFooter(text: string, icon?: string): Embed

Set Footer of the Embed

setImage(image: EmbedImage | string): Embed

Set Image of the Embed

setProvider(name: string, url?: string): Embed

Set Provider of the Embed

setThumbnail(thumbnail: EmbedThumbnail | string): Embed

Set Thumbnail Image of the Embed

setTimestamp(timeString: string): Embed

Set Timestamp of the Embed

setTimestamp(unixTimestamp: number): Embed
setTimestamp(dateObject: Date): Embed
setTitle(title: string): Embed

Set Title of the Embed

Set Embed Type

setURL(url: string | URL): Embed

Set URL of the Embed

setVideo(video: EmbedVideo | string): Embed

Set Embed Video

Convert Embed Object to Embed Payload JSON

Static Properties

MAX_AUTHOR_NAME_LENGTH: number
MAX_DESCRIPTION_LENGTH: number
MAX_EMBED_LENGTH: number
MAX_FIELD_NAME_LENGTH: number
MAX_FIELD_VALUE_LENGTH: number
MAX_FIELDS_LENGTH: number
MAX_TITLE_LENGTH: number