【发布时间】:2021-03-26 01:22:51
【问题描述】:
我是 discordjs 包的新手,我一直在挖掘,但在过去的 2 天里,我被困在这个问题上。
我想要实现的是“问卷调查”,它将引导用户完成一些问题。一个例子是: 用户类型:!askOrder
- 问:你要红酒还是白酒?
- A:白葡萄酒
- 问:你想要白葡萄酒。你喜欢 verdejo 还是 rueda?
- 答:rueda
- 问:它是一个rueda。你想在室温下还是冷藏?
- A:室温。
我所拥有的是:
msg.author.send('Do you want red wine or white wine?');
msg.author.send(WineText)
.then((systemMsg) => {
systemMsg.channel.awaitMessages(response => response.content, {
max: 1,
time: 5000,
errors: ['time'],
}).then((collected) => {
systemMsg.channel.send(`You want ${collected.first().content}. Do you prefer a verdejo or a rueda?`);
collected.channel.awaitMessages(response => response.content, {
max: 1,
time: 10000
});
})then((collected2) => {
systemMsg.channel.send(`A ${collected2.first().content} it's. Do you want it at room temperature or chill? `);
}).catch((err) => {
return;
});
但它只是在提出第二个问题后停止,而不是捕获/收集第二个答案。我到底做错了什么?
非常感谢您的回答!
【问题讨论】:
标签: discord.js