From 6a52afe121e653d67392d3d58a458a4875e94572 Mon Sep 17 00:00:00 2001 From: 5jiji Date: Sun, 31 Dec 2023 02:02:38 +0100 Subject: [PATCH] Fix modal startWith ids --- src/events/Interaction/create.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/events/Interaction/create.ts b/src/events/Interaction/create.ts index c043c82..2c36a66 100755 --- a/src/events/Interaction/create.ts +++ b/src/events/Interaction/create.ts @@ -44,7 +44,13 @@ export default new class InteractionCreate extends Events { const client: ExtendedClient = interaction.client; if (!client.interactions) return; - let modal = client.interactions.modal.name.get(interaction.customId) || client.interactions.modal.startWith.get(interaction.customId); + let modal = client.interactions.modal.name.get(interaction.customId); + if (!modal) { + for (const e of client.interactions.modal.startWith.keys()) { + // @ts-expect-error + if (interaction.customId.startsWith(e)) modal = client.interactions.modal.startWith.get(e); + } + }; if (!modal) return; await modal.execute(interaction).catch(e => {