Modal not responding

My modals were working all night yesterday, but when I attempted to run the commands today I continuously got "Something went wrong try again later". After thinking it was the command I made a new one to test modal form configuration but no matter which way I make the modal form nothing worked, and I kept getting the error. I am getting no console errors and no rate limit errors.
8 Replies
d.js toolkit
d.js toolkit12mo 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! - Marked as resolved by OP
d.js docs
d.js docs12mo 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
treble/luna
treble/luna12mo ago
log if your event fires at all
AthenaRebel
AthenaRebelOP12mo ago
I have it set to log when it runs at all and its detecting the command running but its not detecting a submission because everytime I try it returns that error in discord
treble/luna
treble/luna12mo ago
show your code
AthenaRebel
AthenaRebelOP12mo ago
const { SlashCommandBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder} = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('modaltest')
.setDescription('Displays a modal and replies with the modal input'),
async execute(interaction) {
console.log(`The /modaltest command was used by ${interaction.user.tag}.`);
const modal = new ModalBuilder()
.setCustomId('testModal')
.setTitle('Test Modal');
const textInput = new TextInputBuilder()
.setCustomId('textInput')
.setLabel('Enter some text')
.setStyle(TextInputStyle.Short)
.setPlaceholder('Type here...')
.setRequired(true);
modal.addComponents(new ActionRowBuilder().addComponents(textInput));
await interaction.showModal(modal);
},
async handleModalSubmit(interaction) {
console.log(`Modal submitted by ${interaction.user.tag}.`);
const userInput = interaction.fields.getTextInputValue('textInput');
await interaction.reply({ content: `You entered: ${userInput}`, ephemeral: true });
}
};
const { SlashCommandBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder} = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('modaltest')
.setDescription('Displays a modal and replies with the modal input'),
async execute(interaction) {
console.log(`The /modaltest command was used by ${interaction.user.tag}.`);
const modal = new ModalBuilder()
.setCustomId('testModal')
.setTitle('Test Modal');
const textInput = new TextInputBuilder()
.setCustomId('textInput')
.setLabel('Enter some text')
.setStyle(TextInputStyle.Short)
.setPlaceholder('Type here...')
.setRequired(true);
modal.addComponents(new ActionRowBuilder().addComponents(textInput));
await interaction.showModal(modal);
},
async handleModalSubmit(interaction) {
console.log(`Modal submitted by ${interaction.user.tag}.`);
const userInput = interaction.fields.getTextInputValue('textInput');
await interaction.reply({ content: `You entered: ${userInput}`, ephemeral: true });
}
};
treble/luna
treble/luna12mo ago
and where are you calling the second function? you're also better off using collectors
AthenaRebel
AthenaRebelOP12mo ago
Ok using collectors fixed this 😭 thanks I havent touched djs since 12 so I am slowly learning Am I able to add tags to a forum channel via the bot? I am not seeing it anywhere in Discord API or DJS docs but I could just be blind
Want results from more Discord servers?
Add your server