blob: fc29b568cd5f58f1f60400f8a322831e2ff5f318 [file] [log] [blame]
pineafan6de4da52023-03-07 20:43:44 +00001import { ButtonInteraction, TextInputBuilder } from "discord.js";
Skyler Grey75ea9172022-08-06 10:22:23 +01002import Discord, {
3 CommandInteraction,
4 Message,
TheCodedProf21c08592022-09-13 14:14:43 -04005 ActionRowBuilder,
6 ButtonBuilder,
Skyler Grey11236ba2022-08-08 21:13:33 +01007 ModalSubmitInteraction,
PineaFan100df682023-01-02 13:26:08 +00008 ButtonStyle,
9 TextInputStyle
Skyler Grey75ea9172022-08-06 10:22:23 +010010} from "discord.js";
pineafan73a7c4a2022-07-24 10:38:04 +010011import { modalInteractionCollector } from "./dualCollector.js";
pineafan63fc5e22022-08-04 22:04:10 +010012import EmojiEmbed from "./generateEmojiEmbed.js";
pineafan8b4b17f2022-02-27 20:42:52 +000013import getEmojiByName from "./getEmojiByName.js";
pineafan4f164f32022-02-26 22:07:12 +000014
pineafan02ba0232022-07-24 22:16:15 +010015interface CustomBoolean<T> {
16 title: string;
17 disabled: boolean;
18 value: string | null;
PineaFana34d04b2023-01-03 22:05:42 +000019 notValue: string | null;
pineafan63fc5e22022-08-04 22:04:10 +010020 emoji: string | undefined;
pineafan02ba0232022-07-24 22:16:15 +010021 active: boolean;
22 onClick: () => Promise<T>;
23 response: T | null;
24}
25
pineafan4f164f32022-02-26 22:07:12 +000026class confirmationMessage {
pineafan6de4da52023-03-07 20:43:44 +000027 interaction: CommandInteraction | ButtonInteraction;
pineafan63fc5e22022-08-04 22:04:10 +010028 title = "";
29 emoji = "";
pineafan62ce1922022-08-25 20:34:45 +010030 redEmoji: string | null = null;
PineaFan1dee28f2023-01-16 22:09:07 +000031 failedMessage: string | null = null;
32 failedEmoji: string | null = null;
33 failedStatus: "Success" | "Danger" | "Warning" | null = null;
pineafan63fc5e22022-08-04 22:04:10 +010034 description = "";
Skyler Grey75ea9172022-08-06 10:22:23 +010035 color: "Danger" | "Warning" | "Success" = "Success";
36 customButtons: Record<string, CustomBoolean<unknown>> = {};
pineafan63fc5e22022-08-04 22:04:10 +010037 inverted = false;
pineafan73a7c4a2022-07-24 10:38:04 +010038 reason: string | null = null;
pineafan4f164f32022-02-26 22:07:12 +000039
pineafan1e462ab2023-03-07 21:34:06 +000040 modals: {
41 buttonText: string;
42 emoji: string;
43 customId: string;
44 modal: Discord.ModalBuilder;
TheCodedProf35e73712023-03-10 17:35:35 -050045 values: Record<string, string>;
pineafan1e462ab2023-03-07 21:34:06 +000046 }[] = [];
pineafan6de4da52023-03-07 20:43:44 +000047
48 constructor(interaction: CommandInteraction | ButtonInteraction) {
pineafan4f164f32022-02-26 22:07:12 +000049 this.interaction = interaction;
pineafan4f164f32022-02-26 22:07:12 +000050 }
51
Skyler Grey75ea9172022-08-06 10:22:23 +010052 setTitle(title: string) {
53 this.title = title;
54 return this;
55 }
PineaFan1dee28f2023-01-16 22:09:07 +000056 setEmoji(emoji: string) {
Skyler Grey75ea9172022-08-06 10:22:23 +010057 this.emoji = emoji;
58 return this;
59 }
pineafan62ce1922022-08-25 20:34:45 +010060 setDescription(description: string, timedOut?: string) {
Skyler Grey75ea9172022-08-06 10:22:23 +010061 this.description = description;
PineaFan1dee28f2023-01-16 22:09:07 +000062 if (timedOut) this.failedMessage = timedOut;
Skyler Grey75ea9172022-08-06 10:22:23 +010063 return this;
64 }
65 setColor(color: "Danger" | "Warning" | "Success") {
66 this.color = color;
67 return this;
68 }
69 setInverted(inverted: boolean) {
70 this.inverted = inverted;
71 return this;
72 }
Skyler Greyda16adf2023-03-05 10:22:12 +000073 setFailedMessage(
74 text: string,
75 failedStatus: "Success" | "Danger" | "Warning" | null,
76 failedEmoji: string | null = null
77 ) {
PineaFan1dee28f2023-01-16 22:09:07 +000078 this.failedMessage = text;
79 this.failedStatus = failedStatus;
80 this.failedEmoji = failedEmoji;
81 return this;
82 }
Skyler Grey75ea9172022-08-06 10:22:23 +010083 addCustomBoolean(
84 customId: string,
85 title: string,
86 disabled: boolean,
PineaFan100df682023-01-02 13:26:08 +000087 callback: (() => Promise<unknown>) | null = async () => null,
Skyler Grey75ea9172022-08-06 10:22:23 +010088 callbackClicked: string | null,
PineaFana34d04b2023-01-03 22:05:42 +000089 callbackNotClicked: string | null,
Skyler Grey75ea9172022-08-06 10:22:23 +010090 emoji?: string,
91 initial?: boolean
92 ) {
93 this.customButtons[customId] = {
94 title: title,
95 disabled: disabled,
96 value: callbackClicked,
PineaFana34d04b2023-01-03 22:05:42 +000097 notValue: callbackNotClicked,
Skyler Grey75ea9172022-08-06 10:22:23 +010098 emoji: emoji,
99 active: initial ?? false,
PineaFan100df682023-01-02 13:26:08 +0000100 onClick: callback ?? (async () => null),
Skyler Grey75ea9172022-08-06 10:22:23 +0100101 response: null
102 };
103 return this;
pineafan6fb3e072022-05-20 19:27:23 +0100104 }
pineafan73a7c4a2022-07-24 10:38:04 +0100105 addReasonButton(reason: string) {
106 this.reason = reason;
107 return this;
108 }
TheCodedProfca29ebb2023-03-10 17:40:09 -0500109 addModal(
110 buttonText: string,
111 emoji: string,
112 customId: string,
113 current: Record<string, string>,
114 modal: Discord.ModalBuilder
115 ) {
pineafan6de4da52023-03-07 20:43:44 +0000116 modal.setCustomId(customId);
TheCodedProf35e73712023-03-10 17:35:35 -0500117 this.modals.push({ buttonText, emoji, customId, modal, values: current });
pineafan6de4da52023-03-07 20:43:44 +0000118 return this;
119 }
Skyler Grey11236ba2022-08-08 21:13:33 +0100120 async send(editOnly?: boolean): Promise<{
121 success?: boolean;
122 cancelled?: boolean;
123 components?: Record<string, CustomBoolean<unknown>>;
124 newReason?: string;
pineafan1e462ab2023-03-07 21:34:06 +0000125 modals?: {
126 buttonText: string;
127 emoji: string;
128 customId: string;
129 modal: Discord.ModalBuilder;
TheCodedProf35e73712023-03-10 17:35:35 -0500130 values: Record<string, string>;
pineafan1e462ab2023-03-07 21:34:06 +0000131 }[];
Skyler Grey11236ba2022-08-08 21:13:33 +0100132 }> {
Skyler Greya402d1c2022-08-13 23:18:16 +0100133 let cancelled = false;
134 let success: boolean | undefined = undefined;
135 let returnComponents = false;
136 let newReason = undefined;
137
138 while (!cancelled && success === undefined && !returnComponents && !newReason) {
pineafan63fc5e22022-08-04 22:04:10 +0100139 const fullComponents = [
TheCodedProf35e73712023-03-10 17:35:35 -0500140 new ButtonBuilder()
pineafan02ba0232022-07-24 22:16:15 +0100141 .setCustomId("yes")
142 .setLabel("Confirm")
TheCodedProf21c08592022-09-13 14:14:43 -0400143 .setStyle(this.inverted ? ButtonStyle.Success : ButtonStyle.Danger)
pineafan02ba0232022-07-24 22:16:15 +0100144 .setEmoji(getEmojiByName("CONTROL.TICK", "id")),
TheCodedProf35e73712023-03-10 17:35:35 -0500145 new ButtonBuilder()
pineafan02ba0232022-07-24 22:16:15 +0100146 .setCustomId("no")
147 .setLabel("Cancel")
TheCodedProf35e73712023-03-10 17:35:35 -0500148 .setStyle(ButtonStyle.Danger)
pineafan02ba0232022-07-24 22:16:15 +0100149 .setEmoji(getEmojiByName("CONTROL.CROSS", "id"))
pineafan63fc5e22022-08-04 22:04:10 +0100150 ];
pineafan02ba0232022-07-24 22:16:15 +0100151 Object.entries(this.customButtons).forEach(([k, v]) => {
TheCodedProf35e73712023-03-10 17:35:35 -0500152 const button = new ButtonBuilder()
pineafan02ba0232022-07-24 22:16:15 +0100153 .setCustomId(k)
154 .setLabel(v.title)
TheCodedProf21c08592022-09-13 14:14:43 -0400155 .setStyle(v.active ? ButtonStyle.Success : ButtonStyle.Primary)
Skyler Grey75ea9172022-08-06 10:22:23 +0100156 .setDisabled(v.disabled);
Skyler Grey11236ba2022-08-08 21:13:33 +0100157 if (v.emoji !== undefined) button.setEmoji(getEmojiByName(v.emoji, "id"));
Skyler Grey75ea9172022-08-06 10:22:23 +0100158 fullComponents.push(button);
pineafan63fc5e22022-08-04 22:04:10 +0100159 });
pineafan6de4da52023-03-07 20:43:44 +0000160 for (const modal of this.modals) {
161 fullComponents.push(
TheCodedProf35e73712023-03-10 17:35:35 -0500162 new ButtonBuilder()
pineafan6de4da52023-03-07 20:43:44 +0000163 .setCustomId(modal.customId)
164 .setLabel(modal.buttonText)
165 .setStyle(ButtonStyle.Primary)
166 .setEmoji(getEmojiByName(modal.emoji, "id"))
167 .setDisabled(false)
168 );
169 }
Skyler Grey75ea9172022-08-06 10:22:23 +0100170 if (this.reason !== null)
171 fullComponents.push(
TheCodedProf35e73712023-03-10 17:35:35 -0500172 new ButtonBuilder()
Skyler Grey75ea9172022-08-06 10:22:23 +0100173 .setCustomId("reason")
174 .setLabel("Edit Reason")
TheCodedProf21c08592022-09-13 14:14:43 -0400175 .setStyle(ButtonStyle.Primary)
Skyler Grey75ea9172022-08-06 10:22:23 +0100176 .setEmoji(getEmojiByName("ICONS.EDIT", "id"))
177 .setDisabled(false)
178 );
pineafan63fc5e22022-08-04 22:04:10 +0100179 const components = [];
pineafan02ba0232022-07-24 22:16:15 +0100180 for (let i = 0; i < fullComponents.length; i += 5) {
Skyler Greyda16adf2023-03-05 10:22:12 +0000181 components.push(
182 new ActionRowBuilder<
TheCodedProf35e73712023-03-10 17:35:35 -0500183 | ButtonBuilder
Skyler Greyda16adf2023-03-05 10:22:12 +0000184 | Discord.StringSelectMenuBuilder
185 | Discord.RoleSelectMenuBuilder
186 | Discord.UserSelectMenuBuilder
187 >().addComponents(fullComponents.slice(i, i + 5))
188 );
pineafan02ba0232022-07-24 22:16:15 +0100189 }
pineafan63fc5e22022-08-04 22:04:10 +0100190 const object = {
pineafan377794f2022-04-18 19:01:01 +0100191 embeds: [
pineafan4edb7762022-06-26 19:21:04 +0100192 new EmojiEmbed()
pineafan377794f2022-04-18 19:01:01 +0100193 .setEmoji(this.emoji)
194 .setTitle(this.title)
Skyler Grey75ea9172022-08-06 10:22:23 +0100195 .setDescription(
196 this.description +
197 "\n\n" +
198 Object.values(this.customButtons)
199 .map((v) => {
PineaFana34d04b2023-01-03 22:05:42 +0000200 if (v.active) {
201 return v.value ? `*${v.value}*\n` : "";
202 } else {
203 return v.notValue ? `*${v.notValue}*\n` : "";
204 }
Skyler Greyda16adf2023-03-05 10:22:12 +0000205 })
206 .join("")
Skyler Grey75ea9172022-08-06 10:22:23 +0100207 )
pineafan377794f2022-04-18 19:01:01 +0100208 .setStatus(this.color)
pineafan377794f2022-04-18 19:01:01 +0100209 ],
pineafan02ba0232022-07-24 22:16:15 +0100210 components: components,
pineafan377794f2022-04-18 19:01:01 +0100211 ephemeral: true,
212 fetchReply: true
pineafan63fc5e22022-08-04 22:04:10 +0100213 };
Skyler Grey75ea9172022-08-06 10:22:23 +0100214 let m: Message;
pineafan02ba0232022-07-24 22:16:15 +0100215 try {
Skyler Grey75ea9172022-08-06 10:22:23 +0100216 if (editOnly) {
PineaFan100df682023-01-02 13:26:08 +0000217 m = (await this.interaction.editReply(object)) as unknown as Message;
pineafan02ba0232022-07-24 22:16:15 +0100218 } else {
Skyler Grey11236ba2022-08-08 21:13:33 +0100219 m = (await this.interaction.reply(object)) as unknown as Message;
pineafan02ba0232022-07-24 22:16:15 +0100220 }
PineaFana34d04b2023-01-03 22:05:42 +0000221 } catch (e) {
Skyler Greya402d1c2022-08-13 23:18:16 +0100222 cancelled = true;
223 continue;
Skyler Grey75ea9172022-08-06 10:22:23 +0100224 }
pineafan377794f2022-04-18 19:01:01 +0100225 let component;
226 try {
Skyler Grey75ea9172022-08-06 10:22:23 +0100227 component = await m.awaitMessageComponent({
Skyler Greyda16adf2023-03-05 10:22:12 +0000228 filter: (i) =>
pineafan72659cc2023-05-28 13:36:44 +0100229 i.user.id === this.interaction.user.id &&
230 (i.channel ? i.channel!.id === this.interaction.channel!.id : true),
Skyler Grey75ea9172022-08-06 10:22:23 +0100231 time: 300000
232 });
pineafan377794f2022-04-18 19:01:01 +0100233 } catch (e) {
pineafan1e462ab2023-03-07 21:34:06 +0000234 success = false;
TheCodedProf1c3ad3c2023-01-25 17:58:36 -0500235 break;
pineafan377794f2022-04-18 19:01:01 +0100236 }
237 if (component.customId === "yes") {
Skyler Greyf4f21c42023-03-08 14:36:29 +0000238 await component.deferUpdate();
pineafan63fc5e22022-08-04 22:04:10 +0100239 for (const v of Object.values(this.customButtons)) {
240 if (!v.active) continue;
Skyler Grey75ea9172022-08-06 10:22:23 +0100241 try {
242 v.response = await v.onClick();
243 } catch (e) {
244 console.log(e);
245 }
pineafan63fc5e22022-08-04 22:04:10 +0100246 }
Skyler Greya402d1c2022-08-13 23:18:16 +0100247 success = true;
248 returnComponents = true;
249 continue;
pineafan377794f2022-04-18 19:01:01 +0100250 } else if (component.customId === "no") {
Skyler Greyf4f21c42023-03-08 14:36:29 +0000251 await component.deferUpdate();
Skyler Greya402d1c2022-08-13 23:18:16 +0100252 success = false;
253 returnComponents = true;
254 continue;
pineafan73a7c4a2022-07-24 10:38:04 +0100255 } else if (component.customId === "reason") {
Skyler Grey75ea9172022-08-06 10:22:23 +0100256 await component.showModal(
PineaFan100df682023-01-02 13:26:08 +0000257 new Discord.ModalBuilder()
Skyler Grey75ea9172022-08-06 10:22:23 +0100258 .setCustomId("modal")
259 .setTitle("Editing reason")
260 .addComponents(
PineaFan100df682023-01-02 13:26:08 +0000261 new ActionRowBuilder<TextInputBuilder>().addComponents(
262 new TextInputBuilder()
Skyler Grey75ea9172022-08-06 10:22:23 +0100263 .setCustomId("reason")
264 .setLabel("Reason")
265 .setMaxLength(2000)
266 .setRequired(false)
PineaFan100df682023-01-02 13:26:08 +0000267 .setStyle(TextInputStyle.Paragraph)
Skyler Grey75ea9172022-08-06 10:22:23 +0100268 .setPlaceholder("Spammed in #general")
269 .setValue(this.reason ? this.reason : "")
270 )
271 )
272 );
pineafan73a7c4a2022-07-24 10:38:04 +0100273 await this.interaction.editReply({
Skyler Grey75ea9172022-08-06 10:22:23 +0100274 embeds: [
275 new EmojiEmbed()
276 .setTitle(this.title)
Skyler Grey11236ba2022-08-08 21:13:33 +0100277 .setDescription("Modal opened. If you can't see it, click back and try again.")
Skyler Grey75ea9172022-08-06 10:22:23 +0100278 .setStatus(this.color)
279 .setEmoji(this.emoji)
280 ],
281 components: [
TheCodedProf35e73712023-03-10 17:35:35 -0500282 new ActionRowBuilder<ButtonBuilder>().addComponents(
TheCodedProf21c08592022-09-13 14:14:43 -0400283 new ButtonBuilder()
Skyler Grey75ea9172022-08-06 10:22:23 +0100284 .setLabel("Back")
285 .setEmoji(getEmojiByName("CONTROL.LEFT", "id"))
TheCodedProf21c08592022-09-13 14:14:43 -0400286 .setStyle(ButtonStyle.Primary)
Skyler Grey75ea9172022-08-06 10:22:23 +0100287 .setCustomId("back")
PineaFan100df682023-01-02 13:26:08 +0000288 )
Skyler Grey75ea9172022-08-06 10:22:23 +0100289 ]
pineafan73a7c4a2022-07-24 10:38:04 +0100290 });
291 let out;
292 try {
Skyler Greyda16adf2023-03-05 10:22:12 +0000293 out = (await modalInteractionCollector(
294 m,
295 this.interaction.user
296 )) as Discord.ModalSubmitInteraction | null;
Skyler Grey75ea9172022-08-06 10:22:23 +0100297 } catch (e) {
Skyler Greya402d1c2022-08-13 23:18:16 +0100298 cancelled = true;
299 continue;
Skyler Grey75ea9172022-08-06 10:22:23 +0100300 }
Skyler Grey0d885222023-03-08 21:46:37 +0000301 if (out === null) {
Skyler Greya402d1c2022-08-13 23:18:16 +0100302 cancelled = true;
303 continue;
Skyler Grey11236ba2022-08-08 21:13:33 +0100304 }
Skyler Grey0d885222023-03-08 21:46:37 +0000305 if (out.isButton()) {
306 continue;
307 }
Skyler Grey11236ba2022-08-08 21:13:33 +0100308 if (out instanceof ModalSubmitInteraction) {
Skyler Greya402d1c2022-08-13 23:18:16 +0100309 newReason = out.fields.getTextInputValue("reason");
310 continue;
Skyler Grey75ea9172022-08-06 10:22:23 +0100311 } else {
Skyler Greya402d1c2022-08-13 23:18:16 +0100312 returnComponents = true;
313 continue;
Skyler Grey75ea9172022-08-06 10:22:23 +0100314 }
pineafan6de4da52023-03-07 20:43:44 +0000315 } else if (this.modals.map((m) => m.customId).includes(component.customId)) {
pineafan1e462ab2023-03-07 21:34:06 +0000316 const chosenModal = this.modals.find(
317 (
318 (component) => (m) =>
319 m.customId === component.customId
320 )(component)
321 );
pineafan6de4da52023-03-07 20:43:44 +0000322 await component.showModal(chosenModal!.modal);
323 await this.interaction.editReply({
324 embeds: [
325 new EmojiEmbed()
326 .setTitle(this.title)
327 .setDescription("Modal opened. If you can't see it, click back and try again.")
328 .setStatus(this.color)
329 .setEmoji(this.emoji)
330 ],
331 components: [
TheCodedProf35e73712023-03-10 17:35:35 -0500332 new ActionRowBuilder<ButtonBuilder>().addComponents(
pineafan6de4da52023-03-07 20:43:44 +0000333 new ButtonBuilder()
334 .setLabel("Back")
335 .setEmoji(getEmojiByName("CONTROL.LEFT", "id"))
336 .setStyle(ButtonStyle.Primary)
337 .setCustomId("back")
338 )
339 ]
340 });
341 let out;
342 try {
343 out = (await modalInteractionCollector(
344 m,
345 this.interaction.user
346 )) as Discord.ModalSubmitInteraction | null;
347 } catch (e) {
348 console.log(e);
349 cancelled = true;
350 continue;
351 }
Skyler Grey0d885222023-03-08 21:46:37 +0000352 if (out === null) {
353 cancelled = true;
354 continue;
355 }
356 if (out.isButton()) {
pineafan6de4da52023-03-07 20:43:44 +0000357 continue;
358 }
359 if (out instanceof ModalSubmitInteraction) {
TheCodedProf35e73712023-03-10 17:35:35 -0500360 out.fields.fields.forEach((f, k) => {
361 chosenModal!.values[k] = f.value;
362 });
pineafan6de4da52023-03-07 20:43:44 +0000363 }
364 returnComponents = true;
365 continue;
pineafan02ba0232022-07-24 22:16:15 +0100366 } else {
Skyler Greyf4f21c42023-03-08 14:36:29 +0000367 await component.deferUpdate();
Skyler Grey11236ba2022-08-08 21:13:33 +0100368 this.customButtons[component.customId]!.active = !this.customButtons[component.customId]!.active;
Skyler Greya402d1c2022-08-13 23:18:16 +0100369 returnComponents = true;
370 continue;
pineafan377794f2022-04-18 19:01:01 +0100371 }
pineafan8b4b17f2022-02-27 20:42:52 +0000372 }
Skyler Greya402d1c2022-08-13 23:18:16 +0100373 const returnValue: Awaited<ReturnType<typeof this.send>> = {};
374
pineafan62ce1922022-08-25 20:34:45 +0100375 if (cancelled) {
Skyler Greyda16adf2023-03-05 10:22:12 +0000376 await this.timeoutError();
pineafan62ce1922022-08-25 20:34:45 +0100377 returnValue.cancelled = true;
378 }
TheCodedProff86ba092023-01-27 17:10:07 -0500379 if (success === false) {
PineaFan1dee28f2023-01-16 22:09:07 +0000380 await this.interaction.editReply({
Skyler Greyda16adf2023-03-05 10:22:12 +0000381 embeds: [
382 new EmojiEmbed()
383 .setTitle(this.title)
384 .setDescription(this.failedMessage ?? "*Message timed out*")
385 .setStatus(this.failedStatus ?? "Danger")
386 .setEmoji(this.failedEmoji ?? this.redEmoji ?? this.emoji)
387 ],
388 components: []
PineaFan1dee28f2023-01-16 22:09:07 +0000389 });
pineafan6de4da52023-03-07 20:43:44 +0000390 return { success: false, cancelled: returnValue.cancelled ?? false };
PineaFan1dee28f2023-01-16 22:09:07 +0000391 }
TheCodedProf1c3ad3c2023-01-25 17:58:36 -0500392 if (returnComponents || success !== undefined) returnValue.components = this.customButtons;
393 if (success !== undefined) returnValue.success = success;
Skyler Greya402d1c2022-08-13 23:18:16 +0100394 if (newReason) returnValue.newReason = newReason;
pineafan6de4da52023-03-07 20:43:44 +0000395 returnValue.modals = this.modals;
Skyler Greya402d1c2022-08-13 23:18:16 +0100396
pineafan6de4da52023-03-07 20:43:44 +0000397 const modals = this.modals;
Skyler Greyda16adf2023-03-05 10:22:12 +0000398 const typedReturnValue = returnValue as
399 | { cancelled: true }
pineafan1e462ab2023-03-07 21:34:06 +0000400 | {
401 success: boolean;
402 components: Record<string, CustomBoolean<unknown>>;
403 modals: typeof modals;
404 newReason?: string;
405 }
pineafan6de4da52023-03-07 20:43:44 +0000406 | { newReason: string; components: Record<string, CustomBoolean<unknown>>; modals: typeof modals }
407 | { components: Record<string, CustomBoolean<unknown>>; modals: typeof modals };
PineaFan100df682023-01-02 13:26:08 +0000408
409 return typedReturnValue;
pineafan4f164f32022-02-26 22:07:12 +0000410 }
pineafan62ce1922022-08-25 20:34:45 +0100411
412 async timeoutError(): Promise<void> {
413 await this.interaction.editReply({
414 embeds: [
415 new EmojiEmbed()
416 .setTitle(this.title)
417 .setDescription("We closed this message because it was not used for a while.")
418 .setStatus("Danger")
PineaFan1dee28f2023-01-16 22:09:07 +0000419 .setEmoji("CONTROL.BLOCKCROSS")
pineafan62ce1922022-08-25 20:34:45 +0100420 ],
421 components: []
Skyler Greyda16adf2023-03-05 10:22:12 +0000422 });
pineafan62ce1922022-08-25 20:34:45 +0100423 }
pineafan4f164f32022-02-26 22:07:12 +0000424}
425
pineafan73a7c4a2022-07-24 10:38:04 +0100426export default confirmationMessage;