@abbott-platform/abbott-framework
Version:
Abbott Framework is a framework to bring productivity and abstractions to help you to build awesome chatbots.
40 lines (31 loc) • 767 B
JavaScript
const logging = require('../logging');
/**
* NLP Processor base class.
* @name BaseProcessor
* @class
* @param {string} key
* @param {Object} abbottCore
*/
module.exports = class {
get logger() {
if (!this.__logger) {
this.__logger = logging(`abbott-framework:nlp-processors:${this.key}`);
}
return this.__logger;
}
get config() {
return this.abbottCore.options.nlp[this.key];
}
constructor(key, abbottCore) {
this.key = key;
this.abbottCore = abbottCore;
this.abbottCore.options.nlp[key] = this.abbottCore.options.nlp[key] || {};
this.logger.debug('BaseProcessor -> Initialized');
}
process(message, bot) {
}
processEvent(message, bot, params = null) {
}
eventRequest(eventData) {
}
};