How to use the botframework-schema.ActionTypes.PostBack 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 / BotBuilder-Samples / samples / javascript_nodejs / 08.suggested-actions / bots / suggestedActionsBot.js View on Github external
async sendSuggestedActions(turnContext) {
        const cardActions = [
            {
                type: ActionTypes.PostBack,
                title: 'Red',
                value: 'Red',
                image: 'https://via.placeholder.com/20/FF0000?text=R',
                imageAltText: 'R'
            },
            {
                type: ActionTypes.PostBack,
                title: 'Yellow',
                value: 'Yellow',
                image: 'https://via.placeholder.com/20/FFFF00?text=Y',
                imageAltText: 'Y'
            },
            {
                type: ActionTypes.PostBack,
                title: 'Blue',
                value: 'Blue',
github microsoft / BotBuilder-Samples / samples / javascript_nodejs / 08.suggested-actions / bots / suggestedActionsBot.js View on Github external
{
                type: ActionTypes.PostBack,
                title: 'Red',
                value: 'Red',
                image: 'https://via.placeholder.com/20/FF0000?text=R',
                imageAltText: 'R'
            },
            {
                type: ActionTypes.PostBack,
                title: 'Yellow',
                value: 'Yellow',
                image: 'https://via.placeholder.com/20/FFFF00?text=Y',
                imageAltText: 'Y'
            },
            {
                type: ActionTypes.PostBack,
                title: 'Blue',
                value: 'Blue',
                image: 'https://via.placeholder.com/20/0000FF?text=B',
                imageAltText: 'B'
            }
        ];

        var reply = MessageFactory.suggestedActions(cardActions, 'What is the best color?');
        await turnContext.sendActivity(reply);
    }
}