UNPKG

@ayanaware/bentocord

Version:

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

44 lines 1.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LocalizedEmbedBuilder = void 0; const EmbedBuilder_1 = require("./EmbedBuilder"); class LocalizedEmbedBuilder extends EmbedBuilder_1.EmbedBuilder { constructor(ctx) { super(); this.ctx = ctx; } async setTranslatedTitle(title) { if (typeof title === 'object') title = await this.ctx.formatTranslation(title) || title.key; this.setTitle(title); return this; } async setTranslatedDescription(description) { if (typeof description === 'object') description = await this.ctx.formatTranslation(description); this.setDescription(description); return this; } async setTranslatedAuthor(name, url, iconUrl) { if (typeof name === 'object') name = await this.ctx.formatTranslation(name); this.setAuthor(name, url, iconUrl); return this; } async addTranslatedField(name, value, inline = false) { if (typeof name === 'object') name = await this.ctx.formatTranslation(name); if (typeof value === 'object') value = await this.ctx.formatTranslation(value); this.addField(name, value, inline); return this; } async setTranslatedFooter(text, iconUrl) { if (typeof text === 'object') text = await this.ctx.formatTranslation(text); this.setFooter(text, iconUrl); return this; } } exports.LocalizedEmbedBuilder = LocalizedEmbedBuilder; //# sourceMappingURL=LocalizedEmbedBuilder.js.map