我想要流程用户回复并询问下一个问题。 我用过if ...... else,但这是不好的做法,我怎么能用它来收益?
function* gen() {
let ask1 = yield bot.sendMessage(id, "What is Your fname?");
bot.on("message", msg => {
fname = msg.text;
});
let ask2 = yield bot.sendMessage(id, "What is Your second name?");
bot.on("message", msg => {
sname = msg.text;});
}
但我不明白如何一致地称呼它们,你能帮忙吗?