Open priyansh1161 opened 7 years ago
A higher level abstraction will look something like this
const multibot = new Multibot()
multibot.addInterface(IRCclient(config));
multibot.addInterface(Slackbot(slackConfig));
multibot.addParser(NLPparser({'utf-8': true}));
multibot.on('connected', greetings.welcome); //these events will be triggerd by Interface, parser or any other middleware
multibot.on('newUser', greetings.helper)
Since we are interested in creating an interface to connect to multiple chat rooms, my proposal is to use a middleware based architectural approach ( something like express, koa does ). Now, these middlewares can be platform dependent/independent but they will have specified features e.g NLP, welcome message, reply in 10mins if no human interaction etc.
For now, these middlewares will be divided into two parts
In my opinion using generators will provide a really great flexibility, we can use async-await as well but generators will provide greater control over the middlewares in general.