blob: f5aaa6bc848b9de1f29d3a6816d4ad201a029608 [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) =>
pineafandef38a72023-05-28 12:47:36 +0100229 i.user.id === this.interaction.user.id && (i.channel ? (i.channel!.id === this.interaction.channel!.id) : true),
Skyler Grey75ea9172022-08-06 10:22:23 +0100230 time: 300000
231 });
pineafan377794f2022-04-18 19:01:01 +0100232 } catch (e) {
pineafan1e462ab2023-03-07 21:34:06 +0000233 success = false;
TheCodedProf1c3ad3c2023-01-25 17:58:36 -0500234 break;
pineafan377794f2022-04-18 19:01:01 +0100235 }
236 if (component.customId === "yes") {
Skyler Greyf4f21c42023-03-08 14:36:29 +0000237 await component.deferUpdate();
pineafan63fc5e22022-08-04 22:04:10 +0100238 for (const v of Object.values(this.customButtons)) {
239 if (!v.active) continue;
Skyler Grey75ea9172022-08-06 10:22:23 +0100240 try {
241 v.response = await v.onClick();
242 } catch (e) {
243 console.log(e);
244 }
pineafan63fc5e22022-08-04 22:04:10 +0100245 }
Skyler Greya402d1c2022-08-13 23:18:16 +0100246 success = true;
247 returnComponents = true;
248 continue;
pineafan377794f2022-04-18 19:01:01 +0100249 } else if (component.customId === "no") {
Skyler Greyf4f21c42023-03-08 14:36:29 +0000250 await component.deferUpdate();
Skyler Greya402d1c2022-08-13 23:18:16 +0100251 success = false;
252 returnComponents = true;
253 continue;
pineafan73a7c4a2022-07-24 10:38:04 +0100254 } else if (component.customId === "reason") {
Skyler Grey75ea9172022-08-06 10:22:23 +0100255 await component.showModal(
PineaFan100df682023-01-02 13:26:08 +0000256 new Discord.ModalBuilder()
Skyler Grey75ea9172022-08-06 10:22:23 +0100257 .setCustomId("modal")
258 .setTitle("Editing reason")
259 .addComponents(
PineaFan100df682023-01-02 13:26:08 +0000260 new ActionRowBuilder<TextInputBuilder>().addComponents(
261 new TextInputBuilder()
Skyler Grey75ea9172022-08-06 10:22:23 +0100262 .setCustomId("reason")
263 .setLabel("Reason")
264 .setMaxLength(2000)
265 .setRequired(false)
PineaFan100df682023-01-02 13:26:08 +0000266 .setStyle(TextInputStyle.Paragraph)
Skyler Grey75ea9172022-08-06 10:22:23 +0100267 .setPlaceholder("Spammed in #general")
268 .setValue(this.reason ? this.reason : "")
269 )
270 )
271 );
pineafan73a7c4a2022-07-24 10:38:04 +0100272 await this.interaction.editReply({
Skyler Grey75ea9172022-08-06 10:22:23 +0100273 embeds: [
274 new EmojiEmbed()
275 .setTitle(this.title)
Skyler Grey11236ba2022-08-08 21:13:33 +0100276 .setDescription("Modal opened. If you can't see it, click back and try again.")
Skyler Grey75ea9172022-08-06 10:22:23 +0100277 .setStatus(this.color)
278 .setEmoji(this.emoji)
279 ],
280 components: [
TheCodedProf35e73712023-03-10 17:35:35 -0500281 new ActionRowBuilder<ButtonBuilder>().addComponents(
TheCodedProf21c08592022-09-13 14:14:43 -0400282 new ButtonBuilder()
Skyler Grey75ea9172022-08-06 10:22:23 +0100283 .setLabel("Back")
284 .setEmoji(getEmojiByName("CONTROL.LEFT", "id"))
TheCodedProf21c08592022-09-13 14:14:43 -0400285 .setStyle(ButtonStyle.Primary)
Skyler Grey75ea9172022-08-06 10:22:23 +0100286 .setCustomId("back")
PineaFan100df682023-01-02 13:26:08 +0000287 )
Skyler Grey75ea9172022-08-06 10:22:23 +0100288 ]
pineafan73a7c4a2022-07-24 10:38:04 +0100289 });
290 let out;
291 try {
Skyler Greyda16adf2023-03-05 10:22:12 +0000292 out = (await modalInteractionCollector(
293 m,
294 this.interaction.user
295 )) as Discord.ModalSubmitInteraction | null;
Skyler Grey75ea9172022-08-06 10:22:23 +0100296 } catch (e) {
Skyler Greya402d1c2022-08-13 23:18:16 +0100297 cancelled = true;
298 continue;
Skyler Grey75ea9172022-08-06 10:22:23 +0100299 }
Skyler Grey0d885222023-03-08 21:46:37 +0000300 if (out === null) {
Skyler Greya402d1c2022-08-13 23:18:16 +0100301 cancelled = true;
302 continue;
Skyler Grey11236ba2022-08-08 21:13:33 +0100303 }
Skyler Grey0d885222023-03-08 21:46:37 +0000304 if (out.isButton()) {
305 continue;
306 }
Skyler Grey11236ba2022-08-08 21:13:33 +0100307 if (out instanceof ModalSubmitInteraction) {
Skyler Greya402d1c2022-08-13 23:18:16 +0100308 newReason = out.fields.getTextInputValue("reason");
309 continue;
Skyler Grey75ea9172022-08-06 10:22:23 +0100310 } else {
Skyler Greya402d1c2022-08-13 23:18:16 +0100311 returnComponents = true;
312 continue;
Skyler Grey75ea9172022-08-06 10:22:23 +0100313 }
pineafan6de4da52023-03-07 20:43:44 +0000314 } else if (this.modals.map((m) => m.customId).includes(component.customId)) {
pineafan1e462ab2023-03-07 21:34:06 +0000315 const chosenModal = this.modals.find(
316 (
317 (component) => (m) =>
318 m.customId === component.customId
319 )(component)
320 );
pineafan6de4da52023-03-07 20:43:44 +0000321 await component.showModal(chosenModal!.modal);
322 await this.interaction.editReply({
323 embeds: [
324 new EmojiEmbed()
325 .setTitle(this.title)
326 .setDescription("Modal opened. If you can't see it, click back and try again.")
327 .setStatus(this.color)
328 .setEmoji(this.emoji)
329 ],
330 components: [
TheCodedProf35e73712023-03-10 17:35:35 -0500331 new ActionRowBuilder<ButtonBuilder>().addComponents(
pineafan6de4da52023-03-07 20:43:44 +0000332 new ButtonBuilder()
333 .setLabel("Back")
334 .setEmoji(getEmojiByName("CONTROL.LEFT", "id"))
335 .setStyle(ButtonStyle.Primary)
336 .setCustomId("back")
337 )
338 ]
339 });
340 let out;
341 try {
342 out = (await modalInteractionCollector(
343 m,
344 this.interaction.user
345 )) as Discord.ModalSubmitInteraction | null;
346 } catch (e) {
347 console.log(e);
348 cancelled = true;
349 continue;
350 }
Skyler Grey0d885222023-03-08 21:46:37 +0000351 if (out === null) {
352 cancelled = true;
353 continue;
354 }
355 if (out.isButton()) {
pineafan6de4da52023-03-07 20:43:44 +0000356 continue;
357 }
358 if (out instanceof ModalSubmitInteraction) {
TheCodedProf35e73712023-03-10 17:35:35 -0500359 out.fields.fields.forEach((f, k) => {
360 chosenModal!.values[k] = f.value;
361 });
pineafan6de4da52023-03-07 20:43:44 +0000362 }
363 returnComponents = true;
364 continue;
pineafan02ba0232022-07-24 22:16:15 +0100365 } else {
Skyler Greyf4f21c42023-03-08 14:36:29 +0000366 await component.deferUpdate();
Skyler Grey11236ba2022-08-08 21:13:33 +0100367 this.customButtons[component.customId]!.active = !this.customButtons[component.customId]!.active;
Skyler Greya402d1c2022-08-13 23:18:16 +0100368 returnComponents = true;
369 continue;
pineafan377794f2022-04-18 19:01:01 +0100370 }
pineafan8b4b17f2022-02-27 20:42:52 +0000371 }
Skyler Greya402d1c2022-08-13 23:18:16 +0100372 const returnValue: Awaited<ReturnType<typeof this.send>> = {};
373
pineafan62ce1922022-08-25 20:34:45 +0100374 if (cancelled) {
Skyler Greyda16adf2023-03-05 10:22:12 +0000375 await this.timeoutError();
pineafan62ce1922022-08-25 20:34:45 +0100376 returnValue.cancelled = true;
377 }
TheCodedProff86ba092023-01-27 17:10:07 -0500378 if (success === false) {
PineaFan1dee28f2023-01-16 22:09:07 +0000379 await this.interaction.editReply({
Skyler Greyda16adf2023-03-05 10:22:12 +0000380 embeds: [
381 new EmojiEmbed()
382 .setTitle(this.title)
383 .setDescription(this.failedMessage ?? "*Message timed out*")
384 .setStatus(this.failedStatus ?? "Danger")
385 .setEmoji(this.failedEmoji ?? this.redEmoji ?? this.emoji)
386 ],
387 components: []
PineaFan1dee28f2023-01-16 22:09:07 +0000388 });
pineafan6de4da52023-03-07 20:43:44 +0000389 return { success: false, cancelled: returnValue.cancelled ?? false };
PineaFan1dee28f2023-01-16 22:09:07 +0000390 }
TheCodedProf1c3ad3c2023-01-25 17:58:36 -0500391 if (returnComponents || success !== undefined) returnValue.components = this.customButtons;
392 if (success !== undefined) returnValue.success = success;
Skyler Greya402d1c2022-08-13 23:18:16 +0100393 if (newReason) returnValue.newReason = newReason;
pineafan6de4da52023-03-07 20:43:44 +0000394 returnValue.modals = this.modals;
Skyler Greya402d1c2022-08-13 23:18:16 +0100395
pineafan6de4da52023-03-07 20:43:44 +0000396 const modals = this.modals;
Skyler Greyda16adf2023-03-05 10:22:12 +0000397 const typedReturnValue = returnValue as
398 | { cancelled: true }
pineafan1e462ab2023-03-07 21:34:06 +0000399 | {
400 success: boolean;
401 components: Record<string, CustomBoolean<unknown>>;
402 modals: typeof modals;
403 newReason?: string;
404 }
pineafan6de4da52023-03-07 20:43:44 +0000405 | { newReason: string; components: Record<string, CustomBoolean<unknown>>; modals: typeof modals }
406 | { components: Record<string, CustomBoolean<unknown>>; modals: typeof modals };
PineaFan100df682023-01-02 13:26:08 +0000407
408 return typedReturnValue;
pineafan4f164f32022-02-26 22:07:12 +0000409 }
pineafan62ce1922022-08-25 20:34:45 +0100410
411 async timeoutError(): Promise<void> {
412 await this.interaction.editReply({
413 embeds: [
414 new EmojiEmbed()
415 .setTitle(this.title)
416 .setDescription("We closed this message because it was not used for a while.")
417 .setStatus("Danger")
PineaFan1dee28f2023-01-16 22:09:07 +0000418 .setEmoji("CONTROL.BLOCKCROSS")
pineafan62ce1922022-08-25 20:34:45 +0100419 ],
420 components: []
Skyler Greyda16adf2023-03-05 10:22:12 +0000421 });
pineafan62ce1922022-08-25 20:34:45 +0100422 }
pineafan4f164f32022-02-26 22:07:12 +0000423}
424
pineafan73a7c4a2022-07-24 10:38:04 +0100425export default confirmationMessage;