【发布时间】:2021-02-13 03:07:29
【问题描述】:
我正在尝试等待用户在 .then 触发之前选择年龄,但我无法这样做。将函数拆分而不是使用 .then 会更好吗?
谢谢
async function x() {
await ctx
.reply(
'Select your age',
Markup.keyboard([
['10'],
['11'],
['12'],
])
.oneTime()
.resize()
)
.then(() => {
admin
.database()
.ref('users/' + ctx.message.chat.id)
.set({
username: ctx.message.from.first_name,
rank: ctx.message.text,
});
});
}
【问题讨论】:
标签: node.js async-await telegraf