有没有办法在时间限制到期之前接收来自 discord.js 收集器的消息?我尝试使用collector.on收集,但它在我设置的时间限制后触发。这是我目前拥有的:this.collected = false this.collector = new Discord.MessageCollector(msg.channel, m => m.author.bot === false,{time: 10000}); this.collector.on('collect', message =>{ if(!this.collected){ this.collected = true console.log(message) msg.channel.send(message.content) this.collector.stop() //Insert the same thing here(Copy+Paste the same code here) } });(这一切都是为了全局性,因为它必须是递归的)我希望收集器在收到第一条消息时发出一个事件,但使用当前代码,它只能在时间限制之后执行。
添加回答
举报
0/150
提交
取消