How to use the botbuilder-core.InputHints function in botbuilder-core

To help you get started, we’ve selected a few botbuilder-core 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 / libraries / botbuilder-dialogs / lib / prompts / prompt.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            // Ensure prompts have input hint set
            const opt = Object.assign({}, options);
            if (opt.prompt && typeof opt.prompt === 'object' && typeof opt.prompt.inputHint !== 'string') {
                opt.prompt.inputHint = botbuilder_core_1.InputHints.ExpectingInput;
            }
            if (opt.retryPrompt && typeof opt.retryPrompt === 'object' && typeof opt.retryPrompt.inputHint !== 'string') {
                opt.retryPrompt.inputHint = botbuilder_core_1.InputHints.ExpectingInput;
            }
            // Initialize prompt state
            const state = dc.activeDialog.state;
            state.options = opt;
            state.state = {};
            // Send initial prompt
            yield this.onPrompt(dc.context, state.state, state.options, false);
            return dialog_1.Dialog.EndOfTurn;
        });
    }
github microsoft / botbuilder-js / libraries / botbuilder-dialogs / lib / prompts / oauthPrompt.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            // Ensure prompts have input hint set
            const o = Object.assign({}, options);
            if (o.prompt && typeof o.prompt === 'object' && typeof o.prompt.inputHint !== 'string') {
                o.prompt.inputHint = botbuilder_core_1.InputHints.ExpectingInput;
            }
            if (o.retryPrompt && typeof o.retryPrompt === 'object' && typeof o.retryPrompt.inputHint !== 'string') {
                o.retryPrompt.inputHint = botbuilder_core_1.InputHints.ExpectingInput;
            }
            // Initialize prompt state
            const timeout = typeof this.settings.timeout === 'number' ? this.settings.timeout : 54000000;
            const state = dc.activeDialog.state;
            state.state = {};
            state.options = o;
            state.expires = new Date().getTime() + timeout;
            // Attempt to get the users token
            const output = yield this.getUserToken(dc.context);
            if (output !== undefined) {
                // Return token
                return yield dc.end(output);
            }
            else {
                // Prompt user to login
                yield this.sendOAuthCardAsync(dc.context, state.options.prompt);
github microsoft / botbuilder-js / libraries / botbuilder-dialogs / lib / prompts / activityPrompt.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            // Ensure prompts have input hint set
            const opt = Object.assign({}, options);
            if (opt.prompt && typeof opt.prompt === 'object' && typeof opt.prompt.inputHint !== 'string') {
                opt.prompt.inputHint = botbuilder_core_1.InputHints.ExpectingInput;
            }
            if (opt.retryPrompt && typeof opt.retryPrompt === 'object' && typeof opt.retryPrompt.inputHint !== 'string') {
                opt.retryPrompt.inputHint = botbuilder_core_1.InputHints.ExpectingInput;
            }
            // Initialize prompt state
            const state = dc.activeDialog.state;
            state.options = opt;
            state.state = {};
            // Send initial prompt
            yield this.onPrompt(dc.context, state.state, state.options);
            return dialog_1.Dialog.EndOfTurn;
        });
    }
github microsoft / botbuilder-js / libraries / botbuilder-dialogs / lib / prompts / textPrompt.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            if (isRetry && options.retryPrompt) {
                yield context.sendActivity(options.retryPrompt, undefined, botbuilder_core_1.InputHints.ExpectingInput);
            }
            else if (options.prompt) {
                yield context.sendActivity(options.prompt, undefined, botbuilder_core_1.InputHints.ExpectingInput);
            }
        });
    }
github microsoft / botbuilder-js / libraries / botbuilder-dialogs / lib / prompts / numberPrompt.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            if (isRetry && options.retryPrompt) {
                yield context.sendActivity(options.retryPrompt, undefined, botbuilder_core_1.InputHints.ExpectingInput);
            }
            else if (options.prompt) {
                yield context.sendActivity(options.prompt, undefined, botbuilder_core_1.InputHints.ExpectingInput);
            }
        });
    }
github microsoft / botbuilder-js / libraries / botbuilder-dialogs / lib / prompts / dateTimePrompt.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            if (isRetry && options.retryPrompt) {
                yield context.sendActivity(options.retryPrompt, undefined, botbuilder_core_1.InputHints.ExpectingInput);
            }
            else if (options.prompt) {
                yield context.sendActivity(options.prompt, undefined, botbuilder_core_1.InputHints.ExpectingInput);
            }
        });
    }
github microsoft / botbuilder-js / libraries / botbuilder-dialogs / lib / prompts / attachmentPrompt.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            if (isRetry && options.retryPrompt) {
                yield context.sendActivity(options.retryPrompt, undefined, botbuilder_core_1.InputHints.ExpectingInput);
            }
            else if (options.prompt) {
                yield context.sendActivity(options.prompt, undefined, botbuilder_core_1.InputHints.ExpectingInput);
            }
        });
    }