How to use the botbuilder-adapter-slack.SlackDialog function in botbuilder-adapter-slack

To help you get started, we’ve selected a few botbuilder-adapter-slack 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 howdyai / botkit / packages / testbot / features / slack_features.js View on Github external
controller.on('interactive_message', async (bot, message) => {

            console.log('INTERACTIVE MESSAGE', message);

            switch(message.actions[0].name) {
                case 'replace':
                    await bot.replyInteractive(message,'[ A previous message was successfully replaced with this less exciting one. ]');
                    break;
                case 'dialog':
                    await bot.replyWithDialog(message, new SlackDialog('this is a dialog', '123', 'Submit', [
                        {
                            type: 'text',
                            label: 'Field 1',
                            name: 'field1',
                        },
                        {
                            type: 'text',
                            label: 'Field 2',
                            name: 'field2',
                        }
                    ]).notifyOnCancel(true).state('foo').asObject());
                    break;
                default:
                    await bot.reply(message, 'Got a button click!');
            }
        });
github howdyai / botkit / packages / generator-botkit / generators / slack / templates / features / slack_features.js View on Github external
controller.on('interactive_message', async (bot, message) => {

        console.log('INTERACTIVE MESSAGE', message);

        switch(message.actions[0].name) {
            case 'replace':
                await bot.replyInteractive(message,'[ A previous message was successfully replaced with this less exciting one. ]');
                break;
            case 'dialog':
                await bot.replyWithDialog(message, new SlackDialog('this is a dialog', '123', 'Submit', [
                    {
                        type: 'text',
                        label: 'Field 1',
                        name: 'field1',
                    },
                    {
                        type: 'text',
                        label: 'Field 2',
                        name: 'field2',
                    }
                ]).notifyOnCancel(true).state('foo').asObject());
                break;
            default:
                await bot.reply(message, 'Got a button click!');
        }
    });

botbuilder-adapter-slack

Connect Botkit or BotBuilder to Slack

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis