Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bot.conversationState = new botbuilder_1.ConversationState(new botbuilder_1.MemoryStorage());
// Listen for incoming activities.
server.post('/api/messages', (req, res) => {
adapter.processActivity(req, res, async (context) => {
// Route activity to bot.
await bot.onTurn(context);
});
});
// Initialize bots root dialog
const dialogs = new botbuilder_dialogs_adaptive_1.AdaptiveDialog();
bot.rootDialog = dialogs;
// Handle unknown intents
dialogs.triggers.push(new botbuilder_dialogs_adaptive_1.OnUnknownIntent([
new botbuilder_dialogs_adaptive_1.SetProperty('dialog.age', "'22'"),
new botbuilder_dialogs_adaptive_1.SwitchCondition('dialog.age', null, [
new case_1.Case("21", [
new botbuilder_dialogs_adaptive_1.SendActivity("age is 21!")
]),
new case_1.Case("22", [
new botbuilder_dialogs_adaptive_1.SendActivity("age is 22!")
])
])
]));
//# sourceMappingURL=index.js.map
adapter.processActivity(req, res, async (context) => {
// Route activity to bot.
await bot.onTurn(context);
});
});
// Initialize bots root dialog
const dialogs = new botbuilder_dialogs_adaptive_1.AdaptiveDialog();
bot.rootDialog = dialogs;
// Handle unknown intents
dialogs.triggers.push(new botbuilder_dialogs_adaptive_1.OnUnknownIntent([
new botbuilder_dialogs_adaptive_1.SetProperty('dialog.age', "'22'"),
new botbuilder_dialogs_adaptive_1.SwitchCondition('dialog.age', null, [
new case_1.Case("21", [
new botbuilder_dialogs_adaptive_1.SendActivity("age is 21!")
]),
new case_1.Case("22", [
new botbuilder_dialogs_adaptive_1.SendActivity("age is 22!")
])
])
]));
//# sourceMappingURL=index.js.map
await bot.onTurn(context);
});
});
// Initialize bots root dialog
const dialogs = new AdaptiveDialog();
bot.rootDialog = dialogs;
// Handle unknown intents
dialogs.triggers.push(new OnUnknownIntent([
new SetProperty('dialog.age', "'22'"),
new SwitchCondition('dialog.age', null, [
new Case("21", [
new SendActivity("age is 21!")
]),
new Case("22", [
new SendActivity("age is 22!")
])
])
]));
server.post('/api/messages', (req, res) => {
adapter.processActivity(req, res, async (context) => {
// Route activity to bot.
await bot.onTurn(context);
});
});
// Initialize bots root dialog
const dialogs = new AdaptiveDialog();
bot.rootDialog = dialogs;
// Handle unknown intents
dialogs.triggers.push(new OnUnknownIntent([
new SetProperty('dialog.age', "'22'"),
new SwitchCondition('dialog.age', null, [
new Case("21", [
new SendActivity("age is 21!")
]),
new Case("22", [
new SendActivity("age is 22!")
])
])
]));
(resourceExplorer.getResources('.dialog') || []).forEach(resource => {
if (resource.resourceId !== undefined && resource.resourceId.endsWith('.main.dialog')) {
let dialogName = path.basename(resource.resourceId, '.main.dialog');
const subDialog = resourceExplorer.loadType(resource);
choices.push({value : dialogName});
switchCases.push(new Case(dialogName, [subDialog]));
}
});
rootDialog.generator = new TemplateEngineLanguageGenerator();