How to use the botbuilder-dialogs-adaptive.LogAction 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 / 50. todo-bot / lib / clearToDos / index.js View on Github external
constructor() {
        super('ClearToDos', [
            new botbuilder_dialogs_adaptive_1.LogAction(`ClearToDos: todos = {user.todos}`),
            new botbuilder_dialogs_adaptive_1.IfCondition(`user.todos != null`, [
                new botbuilder_dialogs_adaptive_1.EditArray(botbuilder_dialogs_adaptive_1.ArrayChangeType.clear, 'user.todos'),
                new botbuilder_dialogs_adaptive_1.SendActivity(`All todos removed.`)
            ]).else([
                new botbuilder_dialogs_adaptive_1.SendActivity(`No todos to clear.`)
            ])
        ]);
        // Use parents recognizer
        this.recognizer = recognizer_1.getRecognizer();
    }
}
github microsoft / botbuilder-js / samples / 50. todo-bot / src / deleteToDo / index.ts View on Github external
constructor() {
        super('DeleteToDo', [
            new LogAction(`DeleteToDo: todos = {user.todos}`),
            new IfCondition(`user.todos != null`, [
                new SetProperty('$title', '@title'),
                new ChoiceInput('$title', `Which todo would you like to remove?`, 'user.todos'),
                new EditArray(ArrayChangeType.remove, 'user.todos', '$title'),
                new SendActivity(`Deleted the todo named "{$title}".`),
                new IfCondition(`user.tips.clearToDos != true`, [
                    new SendActivity(`You can delete all your todos by saying "delete all todos".`),
                    new SetProperty('user.tips.clearToDos', 'true')
                ])
            ]).else([
                new SendActivity(`No todos to delete.`)
            ])
        ]);

        // Use parents recognizer
        this.recognizer = getRecognizer();
github microsoft / botbuilder-js / samples / 50. todo-bot / lib / showToDos / index.js View on Github external
constructor() {
        super('ShowToDos', [
            new botbuilder_dialogs_adaptive_1.LogAction(`ShowToDos: todos = {user.todos}`, true),
            new botbuilder_dialogs_adaptive_1.IfCondition(`user.todos != null`, [
                new botbuilder_dialogs_adaptive_1.SendList(`user.todos`, `Here are your todos:`)
            ]).else([
                new botbuilder_dialogs_adaptive_1.SendActivity(`You have no todos.`)
            ])
        ]);
        // Use parents recognizer
        this.recognizer = recognizer_1.getRecognizer();
    }
}
github microsoft / botbuilder-js / samples / 50. todo-bot / lib / deleteToDo / index.js View on Github external
constructor() {
        super('DeleteToDo', [
            new botbuilder_dialogs_adaptive_1.LogAction(`DeleteToDo: todos = {user.todos}`),
            new botbuilder_dialogs_adaptive_1.IfCondition(`user.todos != null`, [
                new botbuilder_dialogs_adaptive_1.SetProperty('$title', '@title'),
                new botbuilder_dialogs_adaptive_1.ChoiceInput('$title', `Which todo would you like to remove?`, 'user.todos'),
                new botbuilder_dialogs_adaptive_1.EditArray(botbuilder_dialogs_adaptive_1.ArrayChangeType.remove, 'user.todos', '$title'),
                new botbuilder_dialogs_adaptive_1.SendActivity(`Deleted the todo named "{$title}".`),
                new botbuilder_dialogs_adaptive_1.IfCondition(`user.tips.clearToDos != true`, [
                    new botbuilder_dialogs_adaptive_1.SendActivity(`You can delete all your todos by saying "delete all todos".`),
                    new botbuilder_dialogs_adaptive_1.SetProperty('user.tips.clearToDos', 'true')
                ])
            ]).else([
                new botbuilder_dialogs_adaptive_1.SendActivity(`No todos to delete.`)
            ])
        ]);
        // Use parents recognizer
        this.recognizer = recognizer_1.getRecognizer();
        // Add interruption rules
github microsoft / botbuilder-js / samples / 50. todo-bot / src / showToDos / index.ts View on Github external
constructor() {
        super('ShowToDos');

        this.triggers.push(new OnBeginDialog([
            new LogAction(`ShowToDos: todos = {user.todos}`, true),
            new IfCondition(`user.todos != null`, [
                new SendList(`user.todos`, `Here are your todos:`)
            ]).else([
                new SendActivity(`You have no todos.`)
            ])
        ]));

        // Use parents recognizer
        this.recognizer = getRecognizer();
    }
}
github microsoft / botbuilder-js / samples / 50. todo-bot / src / clearToDos / index.ts View on Github external
constructor() {
        super('ClearToDos', [
            new LogAction(`ClearToDos: todos = {user.todos}`),
            new IfCondition(`user.todos != null`, [
                new EditArray(ArrayChangeType.clear, 'user.todos'),
                new SendActivity(`All todos removed.`)
            ]).else([
                new SendActivity(`No todos to clear.`)
            ])
        ]);

        // Use parents recognizer
        this.recognizer = getRecognizer();
    }
}