/** @jsx ReactiveDialogs.h */ import iopaBotFramework, { BOT, AppBotExtensions } from '../src/index' import * as iopa from 'iopa' import iopaBotConnectorConsole, { AppConsoleExtensions } from 'iopa-bot-console' import * as ReactiveDialogs from 'reactive-dialogs' import { RDXCard, RDXImageCard } from 'reactive-dialogs' interface App extends iopa.App, AppBotExtensions, AppConsoleExtensions {} const app = (new iopa.App() as any) as App app.use(iopaBotConnectorConsole) // add any first pass intent processors here e.g. Microsoft Luis, IBMWatson etc. app.use(iopaBotFramework) const TestDialog = props => { return ( Yes No Here is a follow on sentence I didn't quite understand your response Please answer yes or no Ok great let's go exercise That is very odd ) } app.reactivedialogs.use(TestDialog) app.intent(BOT.INTENTS.Launch, { utterances: ['/launch', '/open'] }) app.dialog('/', [BOT.INTENTS.Launch], function(context, next) { context.response.say('Hello! Please converse with this bot. ').send() }) app.intent('helloIntent', { utterances: ['hi', 'hello', 'hey'] }, function( context, next ) { context.response.say('Hello World').send() return Promise.resolve() }) app.dialog('/unknown', '*', function(context, next) { context.response .say("I don't know what you mean by " + context[BOT.Text]) .send() return Promise.resolve() }) app.build() app.listen()