Options
All
  • Public
  • Public/Protected
  • All
Menu

Creates a sendable embed

import { Embed } from "@cosmos-xyz/cosmos";

client.on("message", (message) => {
if(message.content === "/test") {
// Create the embed object
const embed = new Embed({ title: "This is a test embed" })
.setDescription("- This also supports Markdown!")
.setColour("RANDOM")
// Send the embed
message.channel!.sendMessage({ content: " ", embeds: [embed] });
}
})

Hierarchy

  • Embed

Index

Constructors

  • new Embed(value?: Partial<SendableEmbed>): Embed

Properties

colour?: string
description?: string
icon_url?: string
media?: string
title?: string
type: "Text"
url?: string

Methods

  • getRandomColour(): string
  • setColor(color: string): Embed
  • Set the embed color

    Parameters

    • color: string

      The color of the embed. Use "RANDOM" or "random" to get random colors

    Returns Embed

  • setColour(colour: string): Embed
  • Set the embed colour

    Parameters

    • colour: string

      The colour of the embed. Use "RANDOM" or "random" to get random colours

    Returns Embed

  • setDescription(desc: string): Embed
  • setIconURL(icon: string): Embed
  • setMedia(media: string): Embed
  • setTitle(title: string): Embed
  • setURL(url: string): Embed

Generated using TypeDoc