discord.js
discord.js copied to clipboard
can't create message collector on ephemeral response without fetching.
Which package is this bug report for?
discord.js
Issue description
InteractionCollector isn't collecting interaction when used along with an ephemeral button interaction reply without fetching. If I fetch the reply or remove ephemeral then it works fine.
Code sample
client.on('interactionCreate', async (interaction) => {
if (!interaction.isButton()) {
return;
}
const msg = await interaction.reply({
content: 'test',
components: [
new ActionRowBuilder<MessageActionRowComponentBuilder>().addComponents([
new ButtonBuilder()
.setCustomId('test')
.setLabel('test')
.setStyle(ButtonStyle.Primary),
]),
],
ephemeral: true,
});
msg
.createMessageComponentCollector({
componentType: ComponentType.Button,
})
.on('collect', (btn) => {
console.log(btn.customId);
});
});
}
Package version
v14
Node.js version
v16.15.0
Operating system
Windows
Priority this issue should have
Low (slightly annoying)
Which partials do you have configured?
Not applicable (subpackage bug)
Which gateway intents are you subscribing to?
Not applicable (subpackage bug)
I have tested this issue on a development release
68d5169
I cannot reproduce. Sample code:
client.on('interactionCreate', async (interaction) => {
if (!interaction.isChatInputCommand()) {
return;
}
const msg = await interaction.reply({
content: 'test',
components: [
new ActionRowBuilder<MessageActionRowComponentBuilder>().addComponents([
new ButtonBuilder()
.setCustomId('test')
.setLabel('test')
.setStyle(ButtonStyle.Primary),
]),
],
ephemeral: true,
});
msg
.createMessageComponentCollector({
componentType: ComponentType.Button,
})
.on('collect', (btn) => {
console.log(btn.customId);
});
});
}
@imranbarbhuiya are you still able to reproduce this? Does the sample above work for you?
We talked on discord I'm able to reproduce it now. The issue is with replying with message components, still looking through to see if this is possible to fix.
Is this going to be fixed? I have the same issue - can repro
Edit: using autoFetch fixed it, still annoying