blob: e1b481afc8e47d8b739f9dbfb0e0b0e9f6cc9a7b [file] [log] [blame]
import { EmbedBuilder } from "@discordjs/builders";
import getEmojiByName from "./getEmojiByName.js";
const colors = {
Danger: 0xf27878,
Warning: 0xf2d478,
Success: 0x68d49e
};
class EmojiEmbed extends EmbedBuilder {
_title = "";
_emoji: string | null = null;
_generateTitle() {
if (this._emoji) { return `${getEmojiByName(this._emoji)} ${this._title}`; }
return this._title;
}
override setTitle(title: string) {
this._title = title;
super.setTitle(this._generateTitle());
return this;
}
setEmoji(emoji: string) {
this._emoji = emoji;
super.setTitle(this._generateTitle());
return this;
}
setStatus(color: "Danger" | "Warning" | "Success") {
this.setColor(colors[color]);
return this;
}
}
export default EmojiEmbed;