Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

384
Visualizações
save/remember an Alexa user's intent confirmation response?

I have a confirmation prompt for one of my Alexa skill's intents, and now I need it to "remember" the user's answer and not ask the user again. Essencially, we want the user to be prompted only on the very first time they use the skill, and then never again. Is that possible?

I'm hoping I don't have to do a total code re-write, and can just update my existing code. Here is my intent's javascript code (simplified) for the lambda function for the skill:

    'myIntent': function() {
    
    // there is a required prompt setup in the language interaction model (in the Alexa Skill Kit platform) 
    // To use it we "deligate" it to Alexa via the delegate dialoge directive.
    
    if (this.event.request.dialogState === 'STARTED') {
        // Pre-fill slots: update the intent object with slot values for which
        // you have defaults, then emit :delegate with this updated intent.
        this.emit(':delegate');
    } else if (this.event.request.dialogState !== 'COMPLETED'){
        this.emit(':delegate');
    } else {
        // completed
        var intentObj = this.event.request.intent;
        if (intentObj.confirmationStatus !== 'CONFIRMED') {
            // not confirmed
            if (intentObj.confirmationStatus !== 'DENIED') {
                // Intent is completed, not confirmed but not denied
                this.emit(':tell', "You have neither confirmed or denied. Please try again.");
            } else {
                // Intent is completed, denied and not confirmed
                this.emit(':ask', 'I am sorry but you cannot continue.');
            }
        } else {
            // intent is completed and confirmed. Success!
            var words = "You have confirmed, thank you!";
            this.response.speak(words);
            this.emit(':responseReady');
        }
    }
},

Thanks for any help!

Update: I have successfully implement this new feature using the accepted answer's help. However I had to totally re-write everything to fit the new version of the Alexa sdk.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can persist/save/remember alexa user's data using persistent attributes.

I recommend you to follow alexa skill sample tutorial zero to hero it summarise everything you need to know about developing a skill on Alexa with examples & videos.

And what you need from this tutorial is the Part 4 - Persistence

And then, it will be as easy as:

attributesManager.setPersistentAttributes(sessionAttributes);
await attributesManager.savePersistentAttributes();
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda