Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在前一个收集器收集discord.js后启动收集器_Javascript_Node.js_Collections_Discord_Discord.js - Fatal编程技术网

Javascript 如何在前一个收集器收集discord.js后启动收集器

Javascript 如何在前一个收集器收集discord.js后启动收集器,javascript,node.js,collections,discord,discord.js,Javascript,Node.js,Collections,Discord,Discord.js,我正在执行一个dank memer heist auto lock命令,在该命令中,我启动了两个具有相同过滤器的收集器,因此两个收集器都在收集第一个我希望第一个收集器收集第一条消息,第二个收集器收集第二条消息 这是我的密码: const filter = m => m.content.includes(message.author.username) && m.author.id === '270904126974590976'; const endf = e =>

我正在执行一个dank memer heist auto lock命令,在该命令中,我启动了两个具有相同过滤器的收集器,因此两个收集器都在收集第一个我希望第一个收集器收集第一条消息,第二个收集器收集第二条消息

这是我的密码:

const filter = m => m.content.includes(message.author.username) && m.author.id === '270904126974590976';
const endf = e => e.content.includes(message.author.username) && e.author.id === '270904126974590976';
 message.channel.send('Listening for a heist in this channel. :eyes:')
const collector = message.channel.createMessageCollector(filter, { time: 15000 });

collector.on('collect', m => {
    message.channel.updateOverwrite(message.channel.guild.roles.everyone, { SEND_MESSAGES: true })
  message.lineReplyNoMention(`${verified} Successfully unlocked **${message.channel.name}** unlocking when heist ends.`)
})
const newcollector = message.channel.createMessageCollector(endf, { time: 90000 })

newcollector.on('collect', e => {
  message.channel.updateOverwrite(message.channel.guild.roles.everyone, { SEND_MESSAGES: false })
  message.lineReplyNoMention(`${verified} Successfully locked **${message.channel.name}**`)
});

newcollector.on('end', collected => {
    message.channel.updateOverwrite(message.channel.guild.roles.everyone, { SEND_MESSAGES: false })
  message.lineReplyNoMention(`${verified} Successfully locked **${message.channel.name}**`)
});

是否有帮助?将第二个收集器放入第一个收集器的回调中?另外,由于两个过滤器都是相同的,您可以合并它们。我尝试将
const filter=..
放在那里,但不起作用,因为它们类似于
collector.start()