forked from hktrpg/TG.line.Discord.Roll.Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (30 loc) · 1.03 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"use strict";
require('dotenv').config();
if (process.env.mongoURL) {
require('./modules/db-connector');
return;
}
require('fs').readdirSync(__dirname + '/modules/').forEach(function (file) {
if (file.match(/\.js$/) && file.match(/^core-/)) {
var name = file.replace('.js', '');
exports[name] = require('./modules/' + file);
}
});
process.on('warning', (warning) => {
console.warn('warning', warning.name); // Print the warning name
console.warn('warning', warning.message); // Print the warning message
console.warn('warning', warning.stack); // Print the stack trace
});
/*
流程解釋
首先這裡會call modules/中的Discord line Telegram 三個檔案
如果在Heroku 有輸入它們各自的TOKEN 的話
服務就會各自啓動
Discord line Telegram三套BOT 都會統一呼叫analytics.js
再由analytics.js 呼叫roll/ 中各個的骰檔
所以基本上,要增加骰組
參考/roll中的DEMO骰組就好
以上, 有不明可以在GITHUB問我
另外, 使用或參考其中代碼的話, 請保持開源
感謝
*/