Browse Source

Added HelpIntent. Resubmitted for certification

tags/v1.0
BinHong Lee 7 years ago
parent
commit
8013f0b28c
2 changed files with 18 additions and 10 deletions
  1. +3
    -0
      speechAssets/IntentSchema.json
  2. +15
    -10
      src/index.js

+ 3
- 0
speechAssets/IntentSchema.json View File

@@ -27,6 +27,9 @@
{ {
"intent": "AnyRequest" "intent": "AnyRequest"
}, },
{
"intent": "AMAZON.HelpIntent"
},
{ {
"intent": "Stop" "intent": "Stop"
} }


+ 15
- 10
src/index.js View File

@@ -9,7 +9,7 @@ exports.handler = function (event, context, callback) {


var handlers = { var handlers = {
'LaunchRequest': function () { 'LaunchRequest': function () {
this.emit(':ask', 'Welcome to Dota 2 Random.')
this.emit(':ask', 'Welcome to Dota 2 Random. Say help for help.')
}, },


'RequestMeleeCarry': function () { 'RequestMeleeCarry': function () {
@@ -17,7 +17,7 @@ var handlers = {
askingConditions[1] = 0 askingConditions[1] = 0
askingConditions[2] = true askingConditions[2] = true
getHero(askingConditions, (name) => { getHero(askingConditions, (name) => {
this.emit(':ask', name)
this.emit(':tell', name)
// this.emit(':ask', 'RequestMeleeCarry') // this.emit(':ask', 'RequestMeleeCarry')
}) })
}, },
@@ -27,7 +27,7 @@ var handlers = {
askingConditions[1] = 0 askingConditions[1] = 0
askingConditions[3] = true askingConditions[3] = true
getHero(askingConditions, (name) => { getHero(askingConditions, (name) => {
this.emit(':ask', name)
this.emit(':tell', name)
// this.emit(':ask', 'RequestMeleeSupport') // this.emit(':ask', 'RequestMeleeSupport')
}) })
}, },
@@ -37,7 +37,7 @@ var handlers = {
askingConditions[1] = 1 askingConditions[1] = 1
askingConditions[2] = true askingConditions[2] = true
getHero(askingConditions, (name) => { getHero(askingConditions, (name) => {
this.emit(':ask', name)
this.emit(':tell', name)
// this.emit(':ask', 'RequestRangedCarry') // this.emit(':ask', 'RequestRangedCarry')
}) })
}, },
@@ -47,7 +47,7 @@ var handlers = {
askingConditions[1] = 1 askingConditions[1] = 1
askingConditions[3] = true askingConditions[3] = true
getHero(askingConditions, (name) => { getHero(askingConditions, (name) => {
this.emit(':ask', name)
this.emit(':tell', name)
// this.emit(':ask', 'RequestRangedSupport') // this.emit(':ask', 'RequestRangedSupport')
}) })
}, },
@@ -56,7 +56,7 @@ var handlers = {
reset() reset()
askingConditions[2] = true askingConditions[2] = true
getHero(askingConditions, (name) => { getHero(askingConditions, (name) => {
this.emit(':ask', name)
this.emit(':tell', name)
// this.emit(':ask', 'RequestCarry') // this.emit(':ask', 'RequestCarry')
}) })
}, },
@@ -65,7 +65,7 @@ var handlers = {
reset() reset()
askingConditions[3] = true askingConditions[3] = true
getHero(askingConditions, (name) => { getHero(askingConditions, (name) => {
this.emit(':ask', name)
this.emit(':tell', name)
// this.emit(':ask', 'RequestSupport') // this.emit(':ask', 'RequestSupport')
}) })
}, },
@@ -74,7 +74,7 @@ var handlers = {
reset() reset()
askingConditions[1] = 0 askingConditions[1] = 0
getHero(askingConditions, (name) => { getHero(askingConditions, (name) => {
this.emit(':ask', name)
this.emit(':tell', name)
// this.emit(':ask', 'RequestMelee') // this.emit(':ask', 'RequestMelee')
}) })
}, },
@@ -83,15 +83,20 @@ var handlers = {
reset() reset()
askingConditions[1] = 1 askingConditions[1] = 1
getHero(askingConditions, (name) => { getHero(askingConditions, (name) => {
this.emit(':ask', name)
this.emit(':tell', name)
// this.emit(':ask', 'RequestRanged') // this.emit(':ask', 'RequestRanged')
}) })
}, },


'AMAZON.HelpIntent': function () {
reset()
this.emit(':ask', 'You can try saying random any hero, random melee carry or random ranged support for more specific randoming.')
},

'AnyRequest': function () { 'AnyRequest': function () {
reset() reset()
getHero(askingConditions, (name) => { getHero(askingConditions, (name) => {
this.emit(':ask', name)
this.emit(':tell', name)
// this.emit(':ask', 'AnyRequest triggered') // this.emit(':ask', 'AnyRequest triggered')
}) })
}, },


Loading…
Cancel
Save