3D_MAMA
3D_MAMA
DIAdiscord.js - Imagine an app
Created by 3D_MAMA on 2/12/2024 in #djs-questions
modal submit unknown interaction
await interaction.showModal(modal); //ButtonInteraction

const filter = (i) =>
i.user.id === interaction.user.id &&
i.customId === modal.data.custom_id;
const modal_submit = await interaction
.awaitModalSubmit({ filter, time: 300_000 })
.catch(() => null);
if (!modal_submit) return;
await modal_submit.deferReply({ ephemeral: true });
await interaction.showModal(modal); //ButtonInteraction

const filter = (i) =>
i.user.id === interaction.user.id &&
i.customId === modal.data.custom_id;
const modal_submit = await interaction
.awaitModalSubmit({ filter, time: 300_000 })
.catch(() => null);
if (!modal_submit) return;
await modal_submit.deferReply({ ephemeral: true });
I get a DiscordAPIError[10062]: Unknown interaction at the last line. Why? It is possible to defer modal submissions, is it? The filter should also account for multiple users submitting modals with the same custom_id, right? So what's the problem? The above code is called through an interactionCreate listener.
5 replies