vylbot-app/src/helpers/embeds/PublicEmbed.ts
Ethan Lane 0315f80976
Add embed tests
Signed-off-by: Ethan Lane <ethan@vylpes.com>
2022-01-29 17:28:10 +00:00

26 lines
No EOL
711 B
TypeScript

import { MessageEmbed } from "discord.js";
import { ICommandContext } from "../../contracts/ICommandContext";
export default class PublicEmbed extends MessageEmbed {
public context: ICommandContext;
constructor(context: ICommandContext, title: string, description: string) {
super();
super.setColor(process.env.EMBED_COLOUR!);
super.setTitle(title);
super.setDescription(description);
this.context = context;
}
// Detail methods
public AddReason(message: String) {
this.addField("Reason", message || "*none*");
}
// Send methods
public SendToCurrentChannel() {
this.context.message.channel.send(this);
}
}