DISCORD BUTTON

can you help me with my code its always say No command matching undefined was found.
try {
//await appendToSheet(auth, spreadsheetId, sheetName, newRow);
var ares = await modalInteraction.reply({
content: 'test',
components: [row],
ephemeral: false,
});
} catch (error) {
console.error(error);
modalInteraction.reply('Terjadi kesalahan saat mengajukan laporan.');
}
const collectorFilter = i => i.user.id === interaction.user.id;
try {
const confirmation = await ares.awaitMessageComponent({ filter: collectorFilter, time: 60_000 });

if (confirmation.customId === 'apv') {
await modalInteraction.reply({ content: `has been banned for reason:`});
}
} catch (e) {
await modalInteraction.editReply({ content: 'Confirmation not received within 1 minute, cancelling'});
};
try {
//await appendToSheet(auth, spreadsheetId, sheetName, newRow);
var ares = await modalInteraction.reply({
content: 'test',
components: [row],
ephemeral: false,
});
} catch (error) {
console.error(error);
modalInteraction.reply('Terjadi kesalahan saat mengajukan laporan.');
}
const collectorFilter = i => i.user.id === interaction.user.id;
try {
const confirmation = await ares.awaitMessageComponent({ filter: collectorFilter, time: 60_000 });

if (confirmation.customId === 'apv') {
await modalInteraction.reply({ content: `has been banned for reason:`});
}
} catch (e) {
await modalInteraction.editReply({ content: 'Confirmation not received within 1 minute, cancelling'});
};
5 Replies
d.js toolkit
d.js toolkit9mo 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
treble/luna
treble/luna9mo ago
I dont see any code there that produces that message Seems like your command handler is the issue
NoodleSTART
NoodleSTART9mo ago
Is it because I using contextmenu? or because i use modals ?
Parogo_72
Parogo_729mo ago
Its because the code you sent has nothing to do with the message you sent
kin.ts
kin.ts9mo ago
can you show us your command handler?