button interaction doesnt work (d.js 14.11.0)

Im making a bot and button interactions dont work, when you hit a button it responds with "the application did not respond". Heres my code: https://hastebin.skyra.pw/junucexuze.js There are some variables that i left out for simplicity's sake but theyre unimportant to the part that doesnt work xd. anyways so i'd appreciate if anyone could help me :)
13 Replies
d.js toolkit
d.js toolkit12mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
treble/luna
treble/luna12mo ago
Its customId, not customID
Slashed
Slashed12mo ago
@luna🌈 Now it just says "this interaction failed"
treble/luna
treble/luna12mo ago
Because you did not reply to the collected interaction
Slashed
Slashed12mo ago
but i run interaction.editReply? oh wait
treble/luna
treble/luna12mo ago
you're editing your original interaction
Slashed
Slashed12mo ago
well if i console.log something in the if check it doesnt even get logged
treble/luna
treble/luna12mo ago
Idk whether filter can be null
Slashed
Slashed12mo ago
fair enough but then how would i not have a filter
treble/luna
treble/luna12mo ago
I would try passing in true, not entirely sure whether that'd worl though also your time can be 15 mins max, the webhook token expires after 15 mins
bornikfik
bornikfik12mo ago
here is my way of doing it no idea if it works but you can try
try {
const col = await interaction.channel.createMessageComponentCollector({
filter: (interaction) => interaction.customId === "join",
time: timeout,
}); // I want everyone to be able to click the button

col.on("collect", async (i) => {
players++;
await i.update({
embeds: [embed],
ephemeral: false,
components: [row],
});
});
}
try {
const col = await interaction.channel.createMessageComponentCollector({
filter: (interaction) => interaction.customId === "join",
time: timeout,
}); // I want everyone to be able to click the button

col.on("collect", async (i) => {
players++;
await i.update({
embeds: [embed],
ephemeral: false,
components: [row],
});
});
}
treble/luna
treble/luna12mo ago
.update will throw an error since the reply hasnt been sent yet i think
bornikfik
bornikfik12mo ago
then use interaction.deferReply()