UNPKG

@ebonydevcopy/framework

Version:

A module-based NodeJS chatbot framework.

32 lines 1.04 kB
/** * ebony-framework * * @module handlers/text * @author Christos Panagiotakopoulos <chrispanag@gmail.com> * @copyright Copyright(c) 2020 Christos Panagiotakopoulos * @license MIT * */ import TextMatcher from '../routers/TextMatcher'; import User from '../models/User'; import { WitNLP } from '../interfaces/nlp'; import Bot from '../bot'; import { ITrackingData } from '../interfaces/trackingData'; /** * @param {TextMatcher} matcher - A TextMatcher Instance * @param {function} nlpHandler - An nlpHandler function * @returns {function} - Returns a textHandler function */ declare type nlpHandlerF<U> = (user: U, message: { text: string; }, nlp: WitNLP) => Promise<any>; export default function textHandlerFactory<U extends User<any>>(matcher?: TextMatcher, nlpHandler?: nlpHandlerF<U>): (this: Bot<U>, message: { text: string; tracking_data?: ITrackingData; location?: { lon: number; lat: number; }; }, nlp: WitNLP | undefined, user: U) => any; export {}; //# sourceMappingURL=text.d.ts.map