【发布时间】:2021-02-21 05:57:14
【问题描述】:
我希望我的机器人在输入特定命令后等待用户的消息,然后像这样使用它:
const { Telegraf } = require('telegraf')
const app = new Telegraf(process.env.BOT_TOKEN);
app.command('request', async(ctx) => {
ctx.reply("Hi user, what is your request?");
//Wait for the user response and use it
ctx.reply("Your answer was: ${user_answer}");
});
【问题讨论】:
-
考虑观看这些examples
标签: javascript node.js async-await telegram telegraf