Leonardo Amaral
Leonardo Amaral

Reputation: 65

how to get a person's name on alexa?

I'm doing a project at alexa, and I want to know how do I get a person's name, example: ask her her name and return "hello {name}"

"'def handle(self, handler_input):
    speech_text = 'say your name'

    handler_input.response_builder.speak(speech_text).ask(speech_text).set_card(
        SimpleCard('test', speech_text)).set_should_end_session(
        False) 
    return handler_input.response_builder.response "'

Upvotes: 1

Views: 298

Answers (1)

Greg Bulmash
Greg Bulmash

Reputation: 1957

You can use one of the Amazon built in slot types like AMAZON.FirstName rather than a custom slot type. Should make it easier.

Creating an intent, using a slot type, and handling slot values are all covered in most intro tutorials. If you need one, since you seem to favor Python, try this one... https://github.com/alexa/skill-sample-python-first-skill

Upvotes: 1

Related Questions