Добрый день.
Прошу специалистов по DialogFlow проконсультировать.
При использовании вебхука в DialogFlow в запросе нужно передавать телефон пользователя из Телеграм.
Как это сделать?
Получен ответ от поддержки DialogFlow, но до конца непонятен.
Have you tried to check the originalDetectintent request from webhook request? Because this field contains original request sent by telegram to Dialogflow.
OriginalDetectIntentRequest can be found on the request.body that you receive on your fulfillment.
If you're using dialogflow-fulfillment library, the code to log request.body should look like this:
// start code
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
const agent = new WebhookClient({ request, response });
console.log('Dialogflow Request body: ' + JSON.stringify(request.body));
// end code
If the phone-number is not there, then you can try to ask twilio's support if they can send phone numbers through their request to Dialogflow.
Опубликован 20.07.2019 в 10:09