Hero Trivia: Coding HelpIntentHandler

We will code the handler for HelpIntent in this lesson.

We'll cover the following

Handle the help intent

On launch, the user is prompted to proceed by either asking for a hero trivia or asking for help. We have handled the scenario where the user asks for hero trivia. Next, let’s wrap up the scenario when the user asks for help.

Head to the HelpIntentHandler and modify the speakOutput. Add a different repromptText in the same way we did earlier.

Change:

const speakOutput = 'You can say hello to me! How can I help?';

to

const speakOutput = 'Hero trivia helps you learn about your favorite superheroes. Try asking me for a hero trivia.';

In a new line below that, add:

const repromptText = 'Try asking me for a hero trivia.';

Replace .reprompt(speakOutput) with .reprompt(repromptText) and click “Save”.

Get hands-on with 1200+ tech skills courses.