Вход в диалог - PullRequest
       23

Вход в диалог

0 голосов
/ 30 октября 2018

Мне нужно включить вход в мой проект диалогового потока. Мне удалось запросить различные необходимые разрешения, но я не могу понять, как получить статус входа.

Вот мой код выполнения webhook:

const functions = require('firebase-functions');
const admin = require('firebase-admin');
const {WebhookClient, Suggestion} = require('dialogflow-fulfillment');
const {dialogflow, Permission, Image, SignIn} = require('actions-on-google');

process.env.DEBUG = 'dialogflow:*'; // enables lib debugging statements
admin.initializeApp(functions.config().firebase);
const db = admin.firestore();
db.settings({timestampsInSnapshots: true});

exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
    const agent = new WebhookClient({request, response});
    let conv = agent.conv();

    function ask_for_sign_in(agent) {
        let conv = agent.conv();
        conv.ask(new SignIn('Per personalizzare'));
        agent.add(conv);
    }

    function actions_intent_SIGN_IN(agent) {

        //GET SIGNIN STATUS HERE

    }

    let intentMap = new Map();

    intentMap.set('ask_for_sign_in', ask_for_sign_in);
    intentMap.set('actions_intent_SIGN_IN', actions_intent_SIGN_IN);

    agent.handleRequest(intentMap);
});
...