在guildMemberAdd事件中的DM通道中创建消息收集器

时间:2020-08-12 16:55:33

标签: javascript discord.js

我正在尝试在DM通道中创建消息收集器,但它不会收集任何消息。 这是我的代码:

member.createDM().then(channel => {
    const filter = m => !m.author.bot;
    const collector = channel.createMessageCollector(filter, { max: 1, time: 10000 });
    collector.on('collect', msg => { 
        if (msg == text) {
            let success = new MessageEmbed()
                .setDescription("You have successfully been verified!")
            channel.send(success)
        } else {
            console.log(msg)
        }
    });
    collector.on('end', collected => console.log(`Collected ${collected.size} items`));
    })

0 个答案:

没有答案