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 toolkit•16mo 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/luna•16mo ago
Its customId, not customID
house
house•16mo ago
@luna🌈 Now it just says "this interaction failed"
treble/luna
treble/luna•16mo ago
Because you did not reply to the collected interaction
house
house•16mo ago
but i run interaction.editReply? oh wait
treble/luna
treble/luna•16mo ago
you're editing your original interaction
house
house•16mo ago
well if i console.log something in the if check it doesnt even get logged
treble/luna
treble/luna•16mo ago
Idk whether filter can be null
house
house•16mo ago
fair enough but then how would i not have a filter
treble/luna
treble/luna•16mo 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
bornikfik•16mo 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/luna•16mo ago
.update will throw an error since the reply hasnt been sent yet i think
bornikfik
bornikfik•16mo ago
then use interaction.deferReply()
Want results from more Discord servers?
Add your server