LotteryAutoScript/lib/Script.js
shanmite 583f690040 pref: 做了一点微小的调整
- 根据是否在action来提示env.js缺失
- `修改PAT` 与 `GITHUB_REPOSITORY`说明
- 修改dyid去重方法
- 去掉几个监视的uid
- 议题模板
2021-05-17 21:49:52 +08:00

53 lines
1.1 KiB
JavaScript

const { tooltip } = require('./Base');
const default_script = {
author: '@shanmite',
UIDs: [
31252386,
35719643,
689277291
],
TAGs: [
'互动抽奖',
'抽奖',
'转发抽奖',
'动态抽奖',
]
};
/**
* 自己修改过的设置
*/
const my_config = (() => {
let _my_config = {}
if (process.env.LOCALLAUNCH) {
try {
const { UIDs, TAGs } = require('../my_config.json');
if (UIDs) _my_config.UIDs = UIDs;
if (TAGs) _my_config.TAGs = TAGs;
} catch (e) {
tooltip.log("[script]无自定义设置\n" + e);
}
} else {
try {
const { MY_CONFIG } = process.env;
if (MY_CONFIG) {
const { UIDs, TAGs } = JSON.parse(MY_CONFIG);
if (UIDs) _my_config.UIDs = UIDs;
if (TAGs) _my_config.TAGs = TAGs;
}
} catch (_) {
tooltip.log("[script]MY_CONFIG语法错误");
}
}
return _my_config;
})();
const script = {
...default_script,
...my_config
}
module.exports = script;