diff options
author | Tom Smeding <t.j.smeding@uu.nl> | 2024-07-22 10:43:21 +0200 |
---|---|---|
committer | Tom Smeding <t.j.smeding@uu.nl> | 2024-07-22 10:43:21 +0200 |
commit | 25f68eb23dd53083e84608e2b1af2109d6a260ac (patch) | |
tree | 1d3f7e8b64e5cac8c23dc57bb68b214e26c77569 /modules/statusbot | |
parent | 9a41d980622b449d41999dc8f46226c1879e00ef (diff) |
Allow failing modules if they miss data files
Diffstat (limited to 'modules/statusbot')
-rw-r--r-- | modules/statusbot/statusbot.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/statusbot/statusbot.js b/modules/statusbot/statusbot.js index 1af5804..a518b17 100644 --- a/modules/statusbot/statusbot.js +++ b/modules/statusbot/statusbot.js @@ -272,8 +272,14 @@ function matrixSendMsgLogin(text, cb) { module.exports = function(app, io, _moddir) { moddir = _moddir; - const config = require("./matrix.json"); - const accounts = require("./accounts.json"); + let config, accounts; + try { + config = require("./matrix.json"); + accounts = require("./accounts.json"); + } catch (e) { + console.error(e); + return false; + } const ratelimit = new PRatelimit(1000); |