From dd8fbd2789ab715bbad394ea131037ffc7d16173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Free=20=E5=85=AC=E5=9C=92?= <45021001+FreeAoi@users.noreply.github.com> Date: Sat, 28 Sep 2024 09:42:47 -0600 Subject: [PATCH] fix: modals execution without .run (#268) * fix: modals execution * fix: lol --- src/structures/Interaction.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/structures/Interaction.ts b/src/structures/Interaction.ts index c97340b..03ee770 100644 --- a/src/structures/Interaction.ts +++ b/src/structures/Interaction.ts @@ -239,9 +239,11 @@ export class BaseInteraction< } const result = await this.matchReplied(body, withResponse); // @ts-expect-error - if (body.data instanceof Modal && body.data.__exec) + if (body.data instanceof Modal) { // @ts-expect-error - this.client.components.modals.set(this.user.id, (body.data as Modal).__exec); + if (body.data.__exec) this.client.components.modals.set(this.user.id, (body.data as Modal).__exec); + else if (this.client.components?.modals.has(this.user.id)) this.client.components.modals.delete(this.user.id); + } return result as never; }