有沒有辦法在時間限制到期之前接收來自 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) } });(這一切都是為了全局性,因為它必須是遞歸的)我希望收集器在收到第一條消息時發出一個事件,但使用當前代碼,它只能在時間限制之后執行。
在discord.js中的時間限制之前獲取收集的消息
郎朗坤
2021-07-03 17:05:14