0
なぜこのコードは任意の場所でユーザメッセージを取得するのか、それともどのボタンでも意味します。「node-telegram-bot-api」モジュール経由でメッセージを受信
私は、ユーザーのメッセージを受け取るでしょう。このコードで、と私はbuttons
除外とprevious buttons
、私はコンソールログユーザー本物のメッセージ(ないボタンタイトルを)必要があるため、 私はContact us
ボタンにいるときだけ、ユーザ・メッセージを取得する必要があります。
bot.on('message', (msg) => {
if (!locale.keyboards[msg.text] &&
!msg.text.includes("Previous Buttons ")) {
console.log("User Message is: " + msg.text)
const opts = {
reply_to_message_id: msg.message_id,
reply_markup: JSON.stringify({
keyboard: arrangeKeyboardWithOut(locale.keyboards["/start"].childs, 2, msg),
resize_keyboard: true,
one_time_keyboard: true
})
};
bot.sendMessage(msg.chat.id, 'Received your message', opts);
}
});