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 toolkit15mo 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/luna15mo ago
I dont see any code there that produces that message Seems like your command handler is the issue
NoodleSTART
NoodleSTARTOP15mo ago
Is it because I using contextmenu? or because i use modals ?
Parogo_72
Parogo_7215mo ago
Its because the code you sent has nothing to do with the message you sent
kin.ts
kin.ts15mo ago
can you show us your command handler?
Want results from more Discord servers?
Add your server