const http = require('http') module.exports = function (myEmitter) { myEmitter.on('text', text => { if (text.text.search('ight') > -1) { if (text.text.search('on') > -1) http.get('http://localhost:3434/on') if (text.text.search('of') > -1) http.get('http://localhost:3434/off') } }) }