-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/help messages #291
base: master
Are you sure you want to change the base?
Feature/help messages #291
Conversation
Thanks! I'd like how do you use And btw we can't use |
debug('INSIDE INTRO'); | ||
dialog.ask(app, { | ||
speech: mustache.render(helpStrings.intro), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you haven't break handler here, so you could have multiple dialog.ask
is it on purpose?
|
||
if (!command) { | ||
debug('Inside state switch...'); | ||
switch (state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use object key-values matching instead of the switch.
The reason: with a key-value object - once we decide to add extra help we would need only add new help string in strings.js
. For the switch design we would need to change handler and strings.js
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, I'd recommend to store strings with speech
field, so we would be able to alter not only speech property of answer but also suggestions
with shortcut options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//strings.js
{
commands: {
collection: {
speech: 'There are two main collections to listen to. Our collection of 78s, which features a variety of genres including jazz, instrumental, and dance. Our other collection is of live concerts. These are live concert recordings that have been uploaded to the Archive. They include artists like the Grateful Dead and the Disco Biscuits.',
suggestions: ['play jazz', 'play grateful dead'],
},
player: {
speech: 'You can control the audio player by saying "pause" to stop the music and "play" to start it again. You can skip to the next song by saying "next song". You can hear the titles of songs in the player by saying "title on". You can turn off this feature by saying "title off".',
suggestions: ['pause', 'next song'],
},
}
}
// ...
//handler.js
//...
dialog.ask(app, helpStrings[command] || helpString.default)
//...
Something like that
}); | ||
} | ||
} // End of switch statement | ||
fsm.transitionTo(app, constants.fsm.states.HELP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need help
state?
// const _ = require('lodash'); | ||
const mustache = require('mustache'); | ||
|
||
const constants = require('../constants'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls put requirements in order of path
This is my first iteration of the help interface action. Still working on adding more catch statements and possible fallbacks but this should be a good start. This is a proposed fix to issue #233.
To use the action, a person would say "help" or "assistance". The action walks them through the current app action (fsm state) that they're in while also giving them pointers on how to use the music player, etc. Also has information about collections. We might eventually want to add an artist search into this because I've found that a lot of users are not aware of what artists are contained in the collections.