|
@ -13,13 +13,14 @@ class Engine { |
|
|
this.initModules(); |
|
|
this.initModules(); |
|
|
|
|
|
|
|
|
/* Bind Message Parsing */ |
|
|
/* Bind Message Parsing */ |
|
|
let handleMessages = function (event, room, toStartOfTimeline) { |
|
|
|
|
|
|
|
|
let handleMessages = (event, room, toStartOfTimeline) => { |
|
|
if (event.getType() !== "m.room.message") { |
|
|
if (event.getType() !== "m.room.message") { |
|
|
logger.debug("Recieved message of type: %s", event.getType()); |
|
|
logger.debug("Recieved message of type: %s", event.getType()); |
|
|
return; // only use messages
|
|
|
return; // only use messages
|
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
logger.debug("[%s] %s", room.name, event.event.content.body); |
|
|
logger.debug("[%s] %s", room.name, event.event.content.body); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.bot.init(handleMessages); |
|
|
this.bot.init(handleMessages); |
|
|
|
|
|
|
|
|