2017-05-26 23:51:48 -04:00
|
|
|
var log = require("./src/util/LogService");
|
|
|
|
var Dimension = require("./src/Dimension");
|
|
|
|
var DimensionStore = require("./src/storage/DimensionStore");
|
2017-05-28 02:35:40 -04:00
|
|
|
var DemoBot = require("./src/matrix/DemoBot");
|
|
|
|
var config = require("config");
|
2017-05-26 23:51:48 -04:00
|
|
|
|
|
|
|
log.info("app", "Bootstrapping Dimension...");
|
|
|
|
var db = new DimensionStore();
|
|
|
|
db.prepare().then(() => {
|
2017-05-28 19:13:03 -04:00
|
|
|
Dimension.start(db);
|
2017-05-28 02:35:40 -04:00
|
|
|
|
|
|
|
if (config.get("demobot.enabled")) {
|
|
|
|
log.info("app", "Demo bot enabled - starting up");
|
|
|
|
var bot = new DemoBot(config.get("demobot.homeserverUrl"), config.get("demobot.userId"), config.get("demobot.accessToken"));
|
|
|
|
bot.start();
|
|
|
|
}
|
2017-05-26 23:51:48 -04:00
|
|
|
}, err => log.error("app", err)).catch(err => log.error("app", err));
|