Using telegram KeyboardButton in dialogflow to get user's phone number sent as a contact when the button is pressed.

Closed Posted 5 years ago Paid on delivery
Closed 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

Node.js

Project ID: #18846192

About the project

Remote project Active 4 years ago