Amazon Alexa: store user's words

前端 未结 6 1549
日久生厌
日久生厌 2020-12-05 10:38

I\'m new to writing Alexa skills and want to write a skill to store the speaker\'s words.
For example, if I say, \'Alexa, save {whatever i say}\', it should save the wor

6条回答
  •  时光取名叫无心
    2020-12-05 11:07

    as of end of 2018 I am using SearchQuery to get whatever the user says.

    It does work, and I have it on production systems.

    But you have to ask the user something and fill the slot.

    For example:

    • Define a slot type of SearchQuery named query (choose whatever name you want)
    • Add sample utterances in the slot prompts like I want to watch {query} or {query} or I want {query}
    • Make a question to the user for slot filling
    const message = 'What movie do you want to watch?'
    
    handlerInput
      .responseBuilder
      .speak(message)
      .reprompt(message)
      .addElicitSlotDirective('query')
      .getResponse();
    

提交回复
热议问题