Skip to content

Commit

Permalink
Fix modal startWith ids
Browse files Browse the repository at this point in the history
  • Loading branch information
5jiji committed Dec 31, 2023
1 parent a9e48b8 commit 6a52afe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/events/Interaction/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 6a52afe

Please sign in to comment.