guess who forgot to add files
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
new file mode 100644
index 0000000..2b769bb
--- /dev/null
+++ b/src/utils/confirmationMessage.ts
@@ -0,0 +1,60 @@
+import Discord, { CommandInteraction, MessageActionRow, Message } from "discord.js";
+import EmojiEmbed from "./generateEmojiEmbed.js"
+
+class confirmationMessage {
+ interaction: CommandInteraction;
+ title: string;
+ emoji: string;
+ description: string;
+ color: string;
+
+ constructor(interaction: CommandInteraction) {
+ this.interaction = interaction;
+
+ this.title = "";
+ this.emoji = "";
+ this.description = "";
+ this.color = "";
+ }
+
+ setTitle(title: string) { this.title = title; return this }
+ setEmoji(emoji: string) { this.emoji = emoji; return this }
+ setDescription(description: string) { this.description = description; return this }
+ setColor(color: string) { this.color = color; return this }
+
+ async send() {
+ let m = await this.interaction.reply({
+ embeds: [
+ new EmojiEmbed()
+ .setEmoji(this.emoji)
+ .setTitle(this.title)
+ .setDescription(this.description)
+ .setStatus(this.color)
+ ],
+ components: [
+ new MessageActionRow().addComponents([
+ new Discord.MessageButton()
+ .setCustomId("yes")
+ .setLabel("Yes")
+ .setStyle("SUCCESS"),
+ new Discord.MessageButton()
+ .setCustomId("no")
+ .setLabel("Cancel") // TODO:
+ .setStyle("DANGER")
+ ])
+ ],
+ ephemeral: true,
+ fetchReply: true
+ })
+ let component;
+ try {
+ component = await (m as Message).awaitMessageComponent({filter: (m) => m.user.id === this.interaction.user.id, time: 2.5 * 60 * 1000});
+ } catch (e) {
+ return false; // TODO: Check the type of the error; change the error message here
+ }
+
+ return component.customId === "yes"
+ }
+}
+
+export default confirmationMessage;
\ No newline at end of file
diff --git a/src/utils/generateEmojiEmbed.ts b/src/utils/generateEmojiEmbed.ts
new file mode 100644
index 0000000..8fe594b
--- /dev/null
+++ b/src/utils/generateEmojiEmbed.ts
@@ -0,0 +1,29 @@
+import Discord, { CommandInteraction, ColorResolvable, MessageEmbed } from "discord.js";
+import getEmojiByName from "./getEmojiByName.js";
+
+const colors = {
+ "Danger": 0xF27878,
+ "Warning": 0xF2D478,
+ "Success": 0x68D49E
+}
+
+class EmojiEmbed extends MessageEmbed {
+ _title: string;
+ _emoji: string;
+
+ // @ts-ignore
+ // This *is* meant to be an accessor rather than a property
+ get title() {
+ return `${getEmojiByName(this._emoji)} ${this._title}`;
+ }
+
+ set title(title: string) {
+ this._title = title;
+ }
+
+ setTitle(title: string) { this._title = title; return this }
+ setEmoji(emoji: string) { this._emoji = emoji; return this }
+ setStatus(color: string) { this.setColor(colors[color]); return this }
+}
+
+export default EmojiEmbed;
\ No newline at end of file
diff --git a/src/utils/generateKeyValueList.ts b/src/utils/generateKeyValueList.ts
new file mode 100644
index 0000000..7f77bef
--- /dev/null
+++ b/src/utils/generateKeyValueList.ts
@@ -0,0 +1,14 @@
+function capitalize(s)
+{
+ return s[0].toUpperCase() + s.slice(1);
+}
+
+function keyValueList(data) {
+ let out = "";
+ Object.entries(data).map(([key, value]) => {
+ out += `**${capitalize(key)}:** ${value}\n`
+ })
+ return out;
+}
+
+export default keyValueList;
\ No newline at end of file
diff --git a/src/utils/getEmojiByName.ts b/src/utils/getEmojiByName.ts
new file mode 100644
index 0000000..64c7ede
--- /dev/null
+++ b/src/utils/getEmojiByName.ts
@@ -0,0 +1,12 @@
+import emojis from '../config/emojis.json' assert {type: 'json'};
+
+function getEmojiByName(name: string): string {
+ let split = name.split(".");
+ let id = emojis
+ split.forEach(part => {
+ id = id[part];
+ });
+ return `<:a:${id}>`;
+}
+
+export default getEmojiByName;