hey guys anybody know how to set up
message.channel.createMessageCollector
for a dm? tried
message.author.dmChannel.createMessageCollector
with no luck.
All TextBasedChannels have the method called createMessageCollector so there's no difference between TextChannel and DMChannel.
You just need to call the method and pass options inside.
// Filter for the collector
const filter = m => m.content.includes('discord');
// Create the collector
const collector = channel.createMessageCollector({ filter, time: 15_000 });
// Listen for new messages and when collector ends
collector.on('collect', m => console.log(`Collected ${m.content}`));
collector.on('end', collected => console.log(`Collected ${collected.size} items`));