从一天开始。问题是这样的。
var alexa = require('alexa-app');
// Define an alexa-app
var myapp = new alexa.app('myapp');
myapp.intent('WelcomeIntent', function(request,response) {
console.log(request);
response.say("This is not working.<break time='2s'/>")
setTimeout(function(){
response.say("This is inside timeout.")
},1000);
});
在语音模拟器Amazon Alexa上,输出看起来像这样。
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "SSML",
"ssml": "<speak>This is not working.<break time='2s'/></speak>"
},
"shouldEndSession": false
},
"sessionAttributes": {}
}
请帮帮我。问题是异步函数内部的响应,如Promise或setTimeout或fetch或google map API,我没有得到正确的响应。