0.16.7 • Published 6 years ago

prague-botbuilder v0.16.7

Weekly downloads
16
License
MIT
Repository
-
Last release
6 years ago

Prague recipe for writing apps using Microsoft BotBuilder 4.x.

To install

npm install -S prague-botbuilder

To use

import { tryInOrder, ifMatches, ifTrue, ifMessage, ifText, ifRegExp } from 'prague-botbuilder';

const router =
    ifMessage()
        .thenTry(
            tryInOrder(
                ifRegExp(/howdy|hi|hello/i).thenDo(c => c.reply(`Hello to you!`)),
                ifRegExp(/what time is it/).thenDo(c => c.reply(`It's showtime.`)),
                ifRegExp(/my name is (.*)/).thenDo((c, matches) => c.reply(`Nice to meet you, ${matches[1]}`))
            )
            .defaultDo(c => c.reply("I will never understand you humans"))
        )
        .elseDo(c => c.reply("non-message activity"))

const bot = new Bot(adapter)
    // add other middleware here
    .onReceive(c => router.route(c));
0.16.7

6 years ago

0.16.6

6 years ago

0.16.5

6 years ago

0.16.4

6 years ago

0.16.2

6 years ago

0.16.1

6 years ago

0.16.0

6 years ago

0.15.9

6 years ago

0.15.6

6 years ago

0.15.5

6 years ago

0.15.4

6 years ago

0.15.3

6 years ago

0.15.2

6 years ago

0.15.1

6 years ago