Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.addRule(new OnIntent('#ShowToDos', [], [
new ShowToDos()
]));
this.addRule(new OnUnknownIntent([
new IfCondition(`user.greeted != true`, [
new SendActivity(`Hi! I'm a ToDo bot. Say "add a todo named first one" to get started.`),
new SetProperty(`user.greeted`, `true`)
]).else([
new SendActivity(`Say "add a todo named first one" to get started.`)
])
]));
// Define rules to handle cancel events
this.addRule(new OnDialogEvent('cancelAdd', [
new SendActivity(`Ok... Cancelled adding new todo.`)
]));
this.addRule(new OnDialogEvent('cancelDelete', [
new SendActivity(`Ok...`)
]));
// Define rules for handling errors
this.addRule(new OnDialogEvent('error', [
new SendActivity(`Oops. An error occurred: {message}`)
]));
}
}
this.addRule(new OnUnknownIntent([
new IfCondition(`user.greeted != true`, [
new SendActivity(`Hi! I'm a ToDo bot. Say "add a todo named first one" to get started.`),
new SetProperty(`user.greeted`, `true`)
]).else([
new SendActivity(`Say "add a todo named first one" to get started.`)
])
]));
// Define rules to handle cancel events
this.addRule(new OnDialogEvent('cancelAdd', [
new SendActivity(`Ok... Cancelled adding new todo.`)
]));
this.addRule(new OnDialogEvent('cancelDelete', [
new SendActivity(`Ok...`)
]));
// Define rules for handling errors
this.addRule(new OnDialogEvent('error', [
new SendActivity(`Oops. An error occurred: {message}`)
]));
}
}
new botbuilder_dialogs_adaptive_1.IfCondition(`user.greeted != true`, [
new botbuilder_dialogs_adaptive_1.SendActivity(`Hi! I'm a ToDo bot. Say "add a todo named first one" to get started.`),
new botbuilder_dialogs_adaptive_1.SetProperty(`user.greeted`, `true`)
]).else([
new botbuilder_dialogs_adaptive_1.SendActivity(`Say "add a todo named first one" to get started.`)
])
]));
// Define rules to handle cancel events
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnDialogEvent('cancelAdd', [
new botbuilder_dialogs_adaptive_1.SendActivity(`Ok... Cancelled adding new todo.`)
]));
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnDialogEvent('cancelDelete', [
new botbuilder_dialogs_adaptive_1.SendActivity(`Ok...`)
]));
// Define rules for handling errors
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnDialogEvent('error', [
new botbuilder_dialogs_adaptive_1.SendActivity(`Oops. An error occurred: {message}`)
]));
}
}
]).else([
new SendActivity(`Say "add a todo named first one" to get started.`)
])
]));
// Define rules to handle cancel events
this.addRule(new OnDialogEvent('cancelAdd', [
new SendActivity(`Ok... Cancelled adding new todo.`)
]));
this.addRule(new OnDialogEvent('cancelDelete', [
new SendActivity(`Ok...`)
]));
// Define rules for handling errors
this.addRule(new OnDialogEvent('error', [
new SendActivity(`Oops. An error occurred: {message}`)
]));
}
}
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnIntent('#ShowToDos', [], [
new showToDos_1.ShowToDos()
]));
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnUnknownIntent([
new botbuilder_dialogs_adaptive_1.IfCondition(`user.greeted != true`, [
new botbuilder_dialogs_adaptive_1.SendActivity(`Hi! I'm a ToDo bot. Say "add a todo named first one" to get started.`),
new botbuilder_dialogs_adaptive_1.SetProperty(`user.greeted`, `true`)
]).else([
new botbuilder_dialogs_adaptive_1.SendActivity(`Say "add a todo named first one" to get started.`)
])
]));
// Define rules to handle cancel events
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnDialogEvent('cancelAdd', [
new botbuilder_dialogs_adaptive_1.SendActivity(`Ok... Cancelled adding new todo.`)
]));
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnDialogEvent('cancelDelete', [
new botbuilder_dialogs_adaptive_1.SendActivity(`Ok...`)
]));
// Define rules for handling errors
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnDialogEvent('error', [
new botbuilder_dialogs_adaptive_1.SendActivity(`Oops. An error occurred: {message}`)
]));
}
}
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnIntent('#ClearToDos', [], [
new clearToDos_1.ClearToDos()
]));
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnIntent('#ShowToDos', [], [
new showToDos_1.ShowToDos()
]));
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnUnknownIntent([
new botbuilder_dialogs_adaptive_1.IfCondition(`user.greeted != true`, [
new botbuilder_dialogs_adaptive_1.SendActivity(`Hi! I'm a ToDo bot. Say "add a todo named first one" to get started.`),
new botbuilder_dialogs_adaptive_1.SetProperty(`user.greeted`, `true`)
]).else([
new botbuilder_dialogs_adaptive_1.SendActivity(`Say "add a todo named first one" to get started.`)
])
]));
// Define rules to handle cancel events
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnDialogEvent('cancelAdd', [
new botbuilder_dialogs_adaptive_1.SendActivity(`Ok... Cancelled adding new todo.`)
]));
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnDialogEvent('cancelDelete', [
new botbuilder_dialogs_adaptive_1.SendActivity(`Ok...`)
]));
// Define rules for handling errors
this.triggers.push(new botbuilder_dialogs_adaptive_1.OnDialogEvent('error', [
new botbuilder_dialogs_adaptive_1.SendActivity(`Oops. An error occurred: {message}`)
]));
}
}