You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running on Artyom.window.min.js v1.0.6 and I am trying to use newPrompt with this following example:
functionstartPrompt(){artyom.newPrompt({question:"How many centimeters should I cut?",//We set the smart property to true to accept wildcardssmart:true,options:["Cut * centimeters","Remove * centimeters"],beforePrompt: ()=>{console.log("Before ask");},onStartPrompt: ()=>{console.log("The prompt is being executed");},onEndPrompt: ()=>{console.log("The prompt has been executed succesfully");},onMatch: (i,wildcard)=>{// i returns the index of the given optionsvaraction;vartotalCentimeters=parseInt(wildcard);action=()=>{alert(wildcard+" centimeters will be removed of your sandwich!");};// A function needs to be returned in onMatch event// in order to accomplish what you want to executereturnaction;}});}
When I run that startPrompt() function above, in the console, I see the onStartPrompt, onEndPrompt, but it returns instantly without the onMatch prompt. It never waited for the user to speak the centimeters before it closed. I don't know what is causing it to end prematurely without waiting for a reply.
I am using Google Chrome v70. Here is how I initialized Artyom:
artyom.initialize({lang:"en-GB",//Listen Forevercontinuous:true,// Log everything in the consoledebug:true,// Keyword used to end a command forcefullyexecutionKeyword: "now",// Initialize artyom !listen:true,soundex: true,name: "vox"});
Can someone please help? Thanks!
The text was updated successfully, but these errors were encountered:
I am running on Artyom.window.min.js v1.0.6 and I am trying to use
newPrompt
with this following example:When I run that
startPrompt()
function above, in the console, I see theonStartPrompt
,onEndPrompt
, but it returns instantly without theonMatch
prompt. It never waited for the user to speak the centimeters before it closed. I don't know what is causing it to end prematurely without waiting for a reply.I am using Google Chrome v70. Here is how I initialized Artyom:
Can someone please help? Thanks!
The text was updated successfully, but these errors were encountered: