createMessageComponentCollector not a function

Hello, I searched this server for my issue and found some similar ones. However, the answer usually seems to be what I'm already doing (awaiting a reply first and calling the create on the reply).
message = await interaction.reply({ embeds: [pageEmbed], components: [row], withResponse: true });

const filter = i => ['prev', 'next'].includes(i.customId) && i.user.id === interaction.user.id && i.message.id === message.id;

const collector = message.createMessageComponentCollector({ filter, componentType: Discord.ComponentType.Button, idle: 120000 });

collector.on('collect', i => {
console.log(i)
}
message = await interaction.reply({ embeds: [pageEmbed], components: [row], withResponse: true });

const filter = i => ['prev', 'next'].includes(i.customId) && i.user.id === interaction.user.id && i.message.id === message.id;

const collector = message.createMessageComponentCollector({ filter, componentType: Discord.ComponentType.Button, idle: 120000 });

collector.on('collect', i => {
console.log(i)
}
Running the code above, I get "message.createMessageComponentCollector is not a function". I saw some examples using .resource.message to access the create method, and when I try that I don't get the error but nothing gets collected
6 Replies
d.js toolkit
d.js toolkit2d 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
Louis
Louis2d ago
InteractionCallbackResponse is not a message
d.js docs
d.js docs2d ago
The fetchReply option when replying to an interaction will be removed in v15.
- {..., fetchReply: true}
+ {..., withResponse: true}
- {..., fetchReply: true}
+ {..., withResponse: true}
This returns an InteractionCallbackResponse Use <InteractionCallbackResponse>.resource.message to get the message
OwlShogunate
OwlShogunateOP2d ago
I see what you're all saying. Historically that filter is because if multiple people call that command, the buttons in the action row affect things they aren't supposed to. Do you have any suggestions for ensuring the interactions it's collecting are coming from the collector that I intend? I see InteractionCallbackResponse has message, but "message created by the interaction" sounds like the opposite of what I want (that being the message that created the interaction)
Louis
Louis2d ago
mhm? it's clearly the message data which you used in interaction.reply (or smthing like that). Or you want to get the messages from the channel?
OwlShogunate
OwlShogunateOP2d ago
Okay, I think I got it, I was just confusing myself a bit there. But I'll rename the stuff to be more accurate as well. Thanks for the help all

Did you find this page helpful?