我正在为电报创建一个TriviaBot样式的bot,我正在使用Node.js这样做。目前,我在捕获用户对测验的响应时遇到问题,以确定用户是否对问题提出了正确与否。以下是一些代码:
bot.onText(/\/quiz/, function (msg) {
var chatId = msg.chat.id;
var text = quizdata.one.msgtxt;
var opts = {
reply_to_message_id: msg.message_id,
reply_markup: JSON.stringify({
keyboard: quizdata.one.keyboard,
one_time_keyboard: true
})
};
bot.sendMessage(chatId, text, opts);
//NEED TO CAPTURE THE USER RESPONSE AND REPLY TO THEIR MESSAGE ACCORDINGLY
});