我的问题如下:''for循环''会等待第一个等待完成,还是会立即触发所有等待消息?
另外,如果响应是“它将触发所有等待消息”,我该如何做到这一点,如果下面的代码被触发进入 for 循环,它会等待等待完成,然后继续 for 循环?
此致。
for(let i = 0; i < parseInt(args[1]); i++) {
message.channel.send("Please write option number " + (i+1) + ".")
await message.channel.awaitMessages(filter, {
max: 1,
time: 120000
}).then(optionmessage => {
try {
optionmessage.first().content.push(optionsarray)
} catch(err) {
return message.channel.send("Time expired.")
}
})
}