Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

dm message collector discordjs

client.on('message', message => {
  if (message.content == `!collect`) {
    // Create a message collector
    const filter = m => (m.content.includes('discord') && m.author.id != client.user.id);
    const channel = message.channel;
    const collector = channel.createMessageCollector(filter, { time: 10000 });
    console.log("collector started");
    collector.on('collect', m => console.log(`Collected ${m.content}`));
    collector.on('end', collected => console.log(`Collected ${collected.size} items`));
  }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dm #message #collector #discordjs
ADD COMMENT
Topic
Name
7+6 =