exports.appname = functions.https.onRequest((request, response) => {
const app = new App({ request, response });
console.log('Request headers: ' + JSON.stringify(request.headers));
console.log('Request body: ' + JSON.stringify(request.body));
// Greet the user and direct them to next turn
function unhandledDeepLinks (app) {
app.ask(`Welcome to Google car assistant `,
NO_INPUTS);
}
// Say a fact
function askrandomquestion (app) {
var randomnumber = Math.random() * (max - min) + min;
switch(randomnumber)
{
//do your logic here
}
};
1 回答
您可以创建一个名为“askrandomquestion”的函数,并从那里提出问题 . 从服务器中的节点js文件中调用“askrandomquestion”(我使用了fire base) .