UNPKG

@ebonydevcopy/framework

Version:

A module-based NodeJS chatbot framework.

39 lines 1.13 kB
/** * ebony-framework * * @module bot * @author Christos Panagiotakopoulos <chrispanag@gmail.com> * @copyright Copyright(c) 2020 Christos Panagiotakopoulos * @license MIT */ import { Scenario, Module, BotOptions } from './interfaces/bot'; import GenericAdapter from './adapter'; import User from './models/User'; import Actions from './utilities/actions'; /** * The Bot Class */ export default class Bot<U extends User<any>> { private postbackRouter; private referralsRouter; private intentRouter; private textMatcher; private attachmentRouter; actions: Actions<U>; private adapter; private yesNoAnswer; complexNlp: (...params: any) => Promise<any>; /** * Create a Bot */ constructor(adapter: GenericAdapter, options: BotOptions<U>); addAttachmentTypeHandler(typeName: string, action: (user: U) => Promise<any>): void; /** * Adds a Module to the chatbot */ addModule(module: Module<U>): void; scenario(user: U): Scenario<GenericAdapter>; private compilePostbackRules; private compileTextRules; } //# sourceMappingURL=bot.d.ts.map