How to use the botbuilder-dialogs.DateTimePrompt function in botbuilder-dialogs

To help you get started, we’ve selected a few botbuilder-dialogs 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-Samples / MigrationV3V4 / Node / core-MultiDialogs-v4 / dialogs / main.js View on Github external
constructor(userState, conversationState) {
        super(MAIN_DIALOG);
        this.userState = userState;
        this.conversationState = conversationState;
        this.userProfileAccessor = userState.createProperty(USER_PROFILE_PROPERTY);
        this.conversationStateAccessor = userState.createProperty(CONVERSATION_STATE_ACCESSOR);

        // Create a dialog set for the bot. It requires a DialogState accessor, with which
        // to retrieve the dialog state from the turn context.
        this.addDialog(new ChoicePrompt(INITIAL_PROMPT, this.validateNumberOfAttempts.bind(this)));
        this.addDialog(new TextPrompt(INITIAL_HOTEL_PROMPT));
        this.addDialog(new DateTimePrompt(CHECKIN_DATETIME_PROMPT));
        this.addDialog(new TextPrompt(HOW_MANY_NIGHTS_PROMPT));
        this.addDialog(new FlightDialog(FLIGHTS_DIALOG));

        // Define the steps of the base waterfall dialog and add it to the set.
        this.addDialog(new WaterfallDialog(BASE_DIALOG, [
            this.promptForBaseChoice.bind(this),
            this.respondToBaseChoice.bind(this),
        ]));

        // Define the steps of the hotels waterfall dialog and add it to the set.
        this.addDialog(new HotelsDialog(HOTELS_DIALOG));

        this.initialDialogId = BASE_DIALOG;

    }
github microsoft / BotFramework-Samples / SDKV4-Samples / js / DialogPromptBot / bot.js View on Github external
constructor(conversationState) {
        // Creates our state accessor properties.
        // See https://aka.ms/about-bot-state-accessors to learn more about the bot state and state accessors.
        this.dialogStateAccessor = conversationState.createProperty(DIALOG_STATE_ACCESSOR);
        this.reservationAccessor = conversationState.createProperty(RESERVATION_ACCESSOR);
        this.conversationState = conversationState;

        // Create the dialog set and add the prompts, including custom validation.
        this.dialogSet = new DialogSet(this.dialogStateAccessor);
        this.dialogSet.add(new NumberPrompt(SIZE_RANGE_PROMPT, this.rangeValidator));
        this.dialogSet.add(new ChoicePrompt(LOCATION_PROMPT));
        this.dialogSet.add(new DateTimePrompt(RESERVATION_DATE_PROMPT, this.dateValidator));

        // Define the steps of the waterfall dialog and add it to the set.
        this.dialogSet.add(new WaterfallDialog(RESERVATION_DIALOG, [
            this.promptForPartySize.bind(this),
            this.promptForLocation.bind(this),
            this.promptForReservationDate.bind(this),
            this.acknowledgeReservation.bind(this),
        ]));
    }
github microsoft / BotBuilder-Samples / samples / javascript_nodejs / 81.skills-skilldialog / dialogSkillBot / dialogs / dateResolverDialog.js View on Github external
constructor(id) {
        super(id || 'dateResolverDialog');
        this.addDialog(new DateTimePrompt(DATETIME_PROMPT, this.dateTimePromptValidator.bind(this)))
            .addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
                this.initialStep.bind(this),
                this.finalStep.bind(this)
            ]));

        this.initialDialogId = WATERFALL_DIALOG;
    }
github microsoft / BotBuilder-Samples / samples / javascript_typescript / 13.core-bot / src / dialogs / dateResolverDialog.ts View on Github external
constructor(id: string) {
        super(id || 'dateResolverDialog');
        this.addDialog(new DateTimePrompt(DATETIME_PROMPT, DateResolverDialog.dateTimePromptValidator.bind(this)))
            .addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
                this.initialStep.bind(this),
                this.finalStep.bind(this),
            ]));

        this.initialDialogId = WATERFALL_DIALOG;
    }
github microsoft / BotBuilder-Samples / generators / generator-botbuilder / generators / app / templates / core / dialogs / dateResolverDialog.ts View on Github external
constructor(id: string) {
        super(id || 'dateResolverDialog');
        this.addDialog(new DateTimePrompt(DATETIME_PROMPT, DateResolverDialog.dateTimePromptValidator.bind(this)))
            .addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
                this.initialStep.bind(this),
                this.finalStep.bind(this)
            ]));

        this.initialDialogId = WATERFALL_DIALOG;
    }
github microsoft / BotBuilder-Samples / samples / typescript_nodejs / 13.core-bot / src / dialogs / dateResolverDialog.ts View on Github external
constructor(id: string) {
        super(id || 'dateResolverDialog');
        this.addDialog(new DateTimePrompt(DATETIME_PROMPT, DateResolverDialog.dateTimePromptValidator.bind(this)))
            .addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
                this.initialStep.bind(this),
                this.finalStep.bind(this)
            ]));

        this.initialDialogId = WATERFALL_DIALOG;
    }
github microsoft / BotBuilder-Samples / samples / javascript_nodejs / 13.core-bot / dialogs / dateResolverDialog.js View on Github external
constructor(id) {
        super(id || 'dateResolverDialog');
        this.addDialog(new DateTimePrompt(DATETIME_PROMPT, this.dateTimePromptValidator.bind(this)))
            .addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
                this.initialStep.bind(this),
                this.finalStep.bind(this)
            ]));

        this.initialDialogId = WATERFALL_DIALOG;
    }
github microsoft / BotBuilder-Samples / samples / javascript_nodejs / language-generation / 13.core-bot / dialogs / dateResolverDialog.js View on Github external
constructor(id) {
        super(id || 'dateResolverDialog');
        this.addDialog(new DateTimePrompt(DATETIME_PROMPT, this.dateTimePromptValidator.bind(this)))
            .addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
                this.initialStep.bind(this),
                this.finalStep.bind(this)
            ]));

        this.initialDialogId = WATERFALL_DIALOG;
    }