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•2y 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
TheoristOP•2y ago
The errors only says Something Went Wrong
d.js docs
d.js docs•2y 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
TheoristOP•2y ago
@wolvinny🌈 it's not logging anything, perhaps do you need the full code?
treble/luna
treble/luna•2y ago
yes
Theorist
TheoristOP•2y ago
d.js docs
d.js docs•2y 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
TheoristOP•2y ago
treble/luna
treble/luna•2y 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•2y ago
guide Creating Your Bot: Command handling read more
treble/luna
treble/luna•2y ago
also your customid's dont match

Did you find this page helpful?