How to use the botbuilder-dialogs-adaptive.ConfirmInput function in botbuilder-dialogs-adaptive

To help you get started, we’ve selected a few botbuilder-dialogs-adaptive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / botbuilder-js / samples / 30. stateMachineDialog / lib / index.js View on Github external
offHook.addRule(new botbuilder_dialogs_adaptive_1.OnIntent('PlaceCallIntent', [
    new botbuilder_dialogs_adaptive_1.EmitEvent('callDialed')
]));
// ringing state
const ringing = dialogs.addState('ringing', [
    new botbuilder_dialogs_adaptive_1.SendActivity(`☎️ ring... ring...`),
    new botbuilder_dialogs_adaptive_1.ConfirmInput('$answer', `Would you like to answer it?`, true),
    new botbuilder_dialogs_adaptive_1.IfCondition('$answer == true', [
        new botbuilder_dialogs_adaptive_1.EmitEvent('callConnected')
    ])
]);
ringing.permit('callConnected', 'connected');
// connected state
const connected = dialogs.addState('connected', [
    new botbuilder_dialogs_adaptive_1.SendActivity(`📞 talk... talk... talk... ☹️`),
    new botbuilder_dialogs_adaptive_1.ConfirmInput('$hangup', `Heard enough yet?`, true),
    new botbuilder_dialogs_adaptive_1.IfCondition('$hangup == true', [
        new botbuilder_dialogs_adaptive_1.EmitEvent('callEnded')
    ])
]);
connected.permit('callEnded', 'offHook');
//# sourceMappingURL=index.js.map
github microsoft / botbuilder-js / samples / 30. stateMachineDialog / lib / index.js View on Github external
const dialogs = new botbuilder_dialogs_adaptive_1.StateMachineDialog('main', 'offHook');
bot.rootDialog = dialogs;
// offHook state
const offHook = dialogs.addState('offHook', [
    new botbuilder_dialogs_adaptive_1.SendActivity(`☎️ off hook`),
    new botbuilder_dialogs_adaptive_1.SendActivity(`say "place a call" to get started.`)
]);
offHook.permit('callDialed', 'ringing');
offHook.recognizer = new botbuilder_dialogs_adaptive_1.RegExpRecognizer().addIntent('PlaceCallIntent', /place .*call/i);
offHook.addRule(new botbuilder_dialogs_adaptive_1.OnIntent('PlaceCallIntent', [
    new botbuilder_dialogs_adaptive_1.EmitEvent('callDialed')
]));
// ringing state
const ringing = dialogs.addState('ringing', [
    new botbuilder_dialogs_adaptive_1.SendActivity(`☎️ ring... ring...`),
    new botbuilder_dialogs_adaptive_1.ConfirmInput('$answer', `Would you like to answer it?`, true),
    new botbuilder_dialogs_adaptive_1.IfCondition('$answer == true', [
        new botbuilder_dialogs_adaptive_1.EmitEvent('callConnected')
    ])
]);
ringing.permit('callConnected', 'connected');
// connected state
const connected = dialogs.addState('connected', [
    new botbuilder_dialogs_adaptive_1.SendActivity(`📞 talk... talk... talk... ☹️`),
    new botbuilder_dialogs_adaptive_1.ConfirmInput('$hangup', `Heard enough yet?`, true),
    new botbuilder_dialogs_adaptive_1.IfCondition('$hangup == true', [
        new botbuilder_dialogs_adaptive_1.EmitEvent('callEnded')
    ])
]);
connected.permit('callEnded', 'offHook');
//# sourceMappingURL=index.js.map
github microsoft / botbuilder-js / samples / 30. stateMachineDialog / src / index.ts View on Github external
// offHook state
const offHook = dialogs.addState('offHook', [
    new SendActivity(`☎️ off hook`),
    new SendActivity(`say "place a call" to get started.`)
]);
offHook.permit('callDialed', 'ringing');
offHook.recognizer = new RegExpRecognizer().addIntent('PlaceCallIntent', /place .*call/i);
offHook.addRule(new OnIntent('PlaceCallIntent', [], [
    new EmitEvent('callDialed')
]));


// ringing state
const ringing = dialogs.addState('ringing', [
    new SendActivity(`☎️ ring... ring...`),
    new ConfirmInput('$answer', `Would you like to answer it?`, true),
    new IfCondition('$answer == true', [
        new EmitEvent('callConnected')
    ])
]);
ringing.permit('callConnected', 'connected');


// connected state
const connected = dialogs.addState('connected', [
    new SendActivity(`📞 talk... talk... talk... ☹️`),
    new ConfirmInput('$hangup', `Heard enough yet?`, true),
    new IfCondition('$hangup == true', [
        new EmitEvent('callEnded')
    ])
]);
connected.permit('callEnded', 'offHook');
github microsoft / botbuilder-js / samples / 30. stateMachineDialog / src / index.ts View on Github external
// ringing state
const ringing = dialogs.addState('ringing', [
    new SendActivity(`☎️ ring... ring...`),
    new ConfirmInput('$answer', `Would you like to answer it?`, true),
    new IfCondition('$answer == true', [
        new EmitEvent('callConnected')
    ])
]);
ringing.permit('callConnected', 'connected');


// connected state
const connected = dialogs.addState('connected', [
    new SendActivity(`📞 talk... talk... talk... ☹️`),
    new ConfirmInput('$hangup', `Heard enough yet?`, true),
    new IfCondition('$hangup == true', [
        new EmitEvent('callEnded')
    ])
]);
connected.permit('callEnded', 'offHook');
github microsoft / BotBuilder-Samples / experimental / adaptive-dialog / javascript_nodejs / 05.multi-turn-prompt / dialogs / userProfileDialog.js View on Github external
new TextInput().configure(
                    {
                        // Set the output of the text input to this property in memory.
                        property: new StringExpression("user.userProfile.Transport"),
                        prompt: new ActivityTemplate("${ModeOfTransportPrompt.Text()}")
                    }),
                    new TextInput().configure(
                    {
                        property: new StringExpression("user.userProfile.Name"),
                        prompt: new ActivityTemplate("${AskForName()}")
                    }),
                    // SendActivity supports full language generation resolution.
                    // See here to learn more about language generation
                    // https://aka.ms/language-generation
                    new SendActivity("${AckName()}"),
                    new ConfirmInput().configure(
                    {
                        property: new StringExpression("turn.ageConfirmation"),
                        prompt: new ActivityTemplate("${AgeConfirmPrompt()}")
                    }),
                    new IfCondition().configure(
                    {
                        // All conditions are expressed using the common expression language.
                        // See https://aka.ms/adaptive-expressions to learn more
                        condition: new BoolExpression("turn.ageConfirmation == true"),
                        actions: [
                            new NumberInput().configure(
                            {
                                prompt: new ActivityTemplate("${AskForAge()}"),
                                property: new StringExpression("user.userProfile.Age"),
                                // Add validations
                                validations: [