Modal Submissions aren't working

Code:
client.on("interactionCreate", async (interaction) => {
if (!interaction.isModalSubmit()) return;

const modalSubmmisionsChannel = client.channels.cache.get('1147403033496526888');

const suggestion = interaction.fields.getTextInputValue('inputSuggestion');

await modalSubmmisionsChannel.send(`Submission: ${suggestion}`);
});
client.on("interactionCreate", async (interaction) => {
if (!interaction.isModalSubmit()) return;

const modalSubmmisionsChannel = client.channels.cache.get('1147403033496526888');

const suggestion = interaction.fields.getTextInputValue('inputSuggestion');

await modalSubmmisionsChannel.send(`Submission: ${suggestion}`);
});
11 Replies
d.js toolkit
d.js toolkit•10mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Theorist
Theorist•10mo ago
The errors only says Something Went Wrong
d.js docs
d.js docs•10mo ago
If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops. - Once you do, log relevant values and if-conditions - More sophisticated debugging methods are breakpoints and runtime inspections: learn more
Theorist
Theorist•10mo ago
@wolvinny🌈 it's not logging anything, perhaps do you need the full code?
treble/luna
treble/luna•10mo ago
yes
Theorist
Theorist•10mo ago
d.js docs
d.js docs•10mo ago
To share long code snippets, use a service like gist, sourcebin, starbin, or similar instead of posting them as large code blocks or files.
Theorist
Theorist•10mo ago
treble/luna
treble/luna•10mo ago
I recommend creating a command / button / etc handler because creating a listener for every interaction is jad practice
d.js docs
d.js docs•10mo ago
guide Creating Your Bot: Command handling read more
treble/luna
treble/luna•10mo ago
also your customid's dont match