静态提示(对NO_INPUT的操作)

时间:2019-07-03 07:37:01

标签: dialogflow actions-on-google

当前,我正在编写代码以实现No_Input response。我已经写了一些代码,但没有给我期望的响应。而且,我想知道我的成就中是否存在任何错误的编码?给我一些指导。

  const {dialogflow} = require('actions-on-google');
  const functions = require('firebase-functions');
  const app = dialogflow({debug: true});
  const NO_INPUT_PROMPTS = ['Would you like to answer the question?'];

  function ask(conv, inputPrompt, noInputPrompts) {
    conv.data.lastPrompt = inputPrompt;
    conv.data.lastNoInputPrompts = noInputPrompts;
    conv.noInputs = noInputPrompts
    conv.ask(inputPrompt);
  }

  app.intent('Default Welcome Intent', conv => {
    let message = "Hello what's your favourite color";
    ask(conv,message,NO_INPUT_PROMPTS);
  })

0 个答案:

没有答案