Using telegram KeyboardButton in dialogflow to get user's phone number sent as a contact when the button is pressed.
$10-30 USD
Paid on delivery
the function below is supposed to provides the fulfillment to the share_your_phone_number intent.
When the intent is invoked, the share your phone number keyboard is displayed for the user in telegram.
The same thing is applicable to the share_your_location intent.
function share_your_phone_number(agent) {
[login to view URL](`Welcome Here.`);
[login to view URL](new Payload("telegram", {
"text": "Please click on button below to share your number",
"reply_markup": {
"one_time_keyboard": true,
"resize_keyboard": true,
"keyboard": [
[
{
"text": "Share my phone number",
"callback_data": "phone",
"request_contact": true
}
],
[
{
"text": "Cancel",
"callback_data": "Cancel"
}
]
]
}
}
));
}
You are required to create a functional code that is able to return the keyboard button and
you are required to create a function that retrieves the return data and store in a function for use or sent to an API for processing.
Please note the environment is the Dialogflow inline editor
Project ID: #18846192