How to use the botframework-schema.InputHints.AcceptingInput function in botframework-schema

To help you get started, we’ve selected a few botframework-schema 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 / botframework-solutions / solutions / Virtual-Assistant / src / typescript / botbuilder-solutions / src / responses / responseTemplate.ts View on Github external
/**
 * Copyright(c) Microsoft Corporation.All rights reserved.
 * Licensed under the MIT License.
 */

import { InputHints } from 'botframework-schema';
import { Reply } from './reply';

export class ResponseTemplate {
    public replies: Reply[] = [];
    public suggestedActions: string[] = [];
    public inputHint: string = InputHints.AcceptingInput;

    public get reply(): Reply | undefined {
        if (this.replies.length > 0) {
            return this.replies[this.getRandom(this.replies.length)];
        }

        return undefined;
    }

    private getRandom(upper: number): number {
        // tslint:disable-next-line:insecure-random
        return Math.floor(Math.random() * upper);
    }
}
github microsoft / botframework-solutions / sdk / typescript / libraries / botbuilder-solutions / src / responses / responseTemplate.ts View on Github external
/**
 * Copyright(c) Microsoft Corporation.All rights reserved.
 * Licensed under the MIT License.
 */

import { InputHints } from 'botframework-schema';
import { IReply } from './reply';

export class ResponseTemplate {
    public replies: IReply[] = [];
    public suggestedActions: string[] = [];
    public inputHint: string = InputHints.AcceptingInput;

    public get reply(): IReply | undefined {
        if (this.replies.length > 0) {
            return this.replies[this.getRandom(this.replies.length)];
        }

        return undefined;
    }

    private getRandom(upper: number): number {
        return Math.floor(Math.random() * upper);
    }
}