Running slash command returns "ExpectedConstraintError > s.number.lessThanOrEqual'

new SlashCommandBuilder() .setName('search') .setDescription('Search Test') .setDefaultPermission(true) .addStringOption(option => option .setName('Term') .setDescription('TermTo Search For') .setRequired(true)
)
2 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!
Method
Method•10mo ago
I thhink it has to do with my EmbedBuilder
await interaction.deferReply({ ephemeral: true });

const termToFind= interaction.options.getString('Term');

let t = await search(termToFind);



if(t.length > 0){
let msgEmbed = new EmbedBuilder()
.setTitle(t.length + " Terms found")
.setDescription("List of found terms")
.setColor("#FFC300")

let ind = 1;

for (const s of t){

msgEmbed.addFields({ name: (ind + '. ' + s), value: ' ' });

ind++

}

await interaction.editReply({
embeds: [msgEmbed]
});
}
else{
await interaction.editReply({
content: `Nothing found.`,
});
}
await interaction.deferReply({ ephemeral: true });

const termToFind= interaction.options.getString('Term');

let t = await search(termToFind);



if(t.length > 0){
let msgEmbed = new EmbedBuilder()
.setTitle(t.length + " Terms found")
.setDescription("List of found terms")
.setColor("#FFC300")

let ind = 1;

for (const s of t){

msgEmbed.addFields({ name: (ind + '. ' + s), value: ' ' });

ind++

}

await interaction.editReply({
embeds: [msgEmbed]
});
}
else{
await interaction.editReply({
content: `Nothing found.`,
});
}
100% did run it just didnt paste the WHOLE command in here only what was relevant, that said issue is there is a 25 field item limit. Thanks 🙂 oh haha yeah I edited it from its real name so yes that is a difference you are not wrong