Я пытаюсь выполнить этот код в облачных функциях Firebase
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const firebase_database = require('./conf/firebase');
const { WebhookClient } = require('dialogflow-fulfillment');
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
function searcheColleagueByName(agent){
var lastname = agent.parameters.lastname;
firebase_database.ref().once('value')
.then(team => {
agent.add("some name " + lastname);
})
.catch(err=>{
agent.add("something wrong");
})
}
и после того, как я делаю запрос к своему боту из Telegram, я получаю сообщение об ошибке в консоли Firebase:
Error: No responses defined for platform: null
at V2Agent.sendResponses_ (/srv/node_modules/dialogflow-fulfillment/src/v2-agent.js:243:13)
at WebhookClient.send_ (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:505:17)
at promise.then (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:316:38)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
Чтонеправильно?почему, когда я использую promisse
, мой агент не может дать мне ответ?