|
|
@ -2,7 +2,8 @@ let { logger } = require('./logging'); |
|
|
|
let { modules } = require('./module/index') |
|
|
|
|
|
|
|
class Engine { |
|
|
|
constructor(bot, modules) { |
|
|
|
constructor(config, bot, modules) { |
|
|
|
this.config = config |
|
|
|
this.bot = bot; |
|
|
|
this.modules = modules; |
|
|
|
} |
|
|
@ -14,6 +15,7 @@ class Engine { |
|
|
|
/* Bind Message Parsing */ |
|
|
|
let handleMessages = function (event, room, toStartOfTimeline) { |
|
|
|
if (event.getType() !== "m.room.message") { |
|
|
|
logger.debug("Recieved message of type: %s", event.getType()); |
|
|
|
return; // only use messages
|
|
|
|
} |
|
|
|
logger.debug("[%s] %s", room.name, event.event.content.body); |
|
|
@ -53,8 +55,8 @@ class Engine { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function create(bot) { |
|
|
|
return new Engine(bot, modules) |
|
|
|
function create(config, bot) { |
|
|
|
return new Engine(config, bot, modules) |
|
|
|
} |
|
|
|
|
|
|
|
exports.create = create; |