var option = {
"parse_mode": "Markdown",
"reply_markup": {
"one_time_keyboard": true,
"keyboard": [[{
text: "My phone number",
request_contact: true
}], ["Cancel"]]
}
};
`bot.sendMessage(msg.chat.id, "How can we contact you?", option).then(() => {
bot.once("contact",(msg)=>{
console.log(msg);
var option = {
"parse_mode": "Markdown",
"reply_markup": {
"one_time_keyboard": true,
"keyboard": [[{
text: "My location",
request_location: true
}], ["Cancel"]]
}
};
bot.sendMessage(msg.chat.id,
'Thank you %s with phone %s! And where are you?', msg.chat.first_name, msg.contact.phone_number)
.then(() => {
bot.once("location",(msg)=>{
bot.sendMessage(msg.chat.id, "We will deliver your order to " + [msg.location.longitude,msg.location.latitude].join(";"));
})
})
})
})
})
})
there is an error
Обсуждают сегодня