@oebot/core
Version:
能跑就行的 QQ 机器人框架,基于 oicq v2,改自KiviBot(R.I.P.)
22 lines (21 loc) • 750 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.saveOEConf = exports.oeConf = void 0;
const fs_extra_1 = require("fs-extra");
const logger_1 = require("./logger");
const path_1 = require("./path");
const start_1 = require("./start");
exports.oeConf = {};
/** 保存 OEBot 框架配置到配置文件`config.json` */
const saveOEConf = (_plugins) => {
try {
exports.oeConf.plugins = [...(_plugins ?? start_1.plugins).keys()];
(0, fs_extra_1.writeJsonSync)(path_1.ConfigPath, exports.oeConf, { encoding: 'utf-8', spaces: 2 });
return true;
}
catch (e) {
logger_1.OELogger.error(JSON.stringify(e, null, 2));
return false;
}
};
exports.saveOEConf = saveOEConf;