📜  dm 消息收集器 discordjs - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:07.785000             🧑  作者: Mango

代码示例2
// `m` is a message object that will be passed through the filter function
const filter = m => m.content.includes('discord');
const collector = message.channel.createMessageCollector(filter, { time: 15000 });

collector.on('collect', m => {
    console.log(`Collected ${m.content}`);
});

collector.on('end', collected => {
    console.log(`Collected ${collected.size} items`);
});