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