UNPKG

@ayanaware/bentocord

Version:

Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots.

68 lines 1.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EmbedBuilder = void 0; /* eslint-disable @typescript-eslint/naming-convention */ class EmbedBuilder { constructor() { this.type = 'rich'; this.fields = []; } setTitle(title) { this.title = title; return this; } setDescription(description) { this.description = description; return this; } setUrl(url) { this.url = url; return this; } setColor(color) { this.color = color; return this; } setAuthor(name, url, iconUrl) { this.author = { name, url, icon_url: iconUrl }; return this; } addField(name, value, inline = false) { this.fields.push({ name, value, inline }); return this; } setThumbnail(url) { this.thumbnail = { url }; return this; } setImage(url) { this.image = { url }; return this; } setFooter(text, iconUrl) { this.footer = { text, icon_url: iconUrl }; return this; } setTimestamp(timestamp = new Date()) { this.timestamp = timestamp; return this; } // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types toJSON() { return { type: this.type, title: this.title, description: this.description, url: this.url, author: this.author, timestamp: this.timestamp, color: this.color, fields: this.fields, thumbnail: this.thumbnail, image: this.image, footer: this.footer, }; } } exports.EmbedBuilder = EmbedBuilder; //# sourceMappingURL=EmbedBuilder.js.map