fix:修复配置问题

This commit is contained in:
Jerry 2025-09-26 18:28:30 +08:00
parent 6c14830af3
commit 4d40e13432
2 changed files with 5 additions and 5 deletions

View File

@ -26,13 +26,13 @@ export default class ReportBots extends plugin {
async autoReport() {
logger.mark(`[crystelf-admin] 正在自动同步bot数据到晶灵核心..`);
if (configControl.get('config')?.core) {
if (configControl.get()?.core) {
await botControl.reportBots();
}
}
async manualReport(e) {
if (!configControl.get('config')?.core) {
if (!configControl.get()?.core) {
return e.reply(`[crystelf-admin] 晶灵核心未启用..`, true);
}
let success = await botControl.reportBots();
@ -51,10 +51,10 @@ export default class ReportBots extends plugin {
await e.reply(`开始广播消息到所有群..`);
try {
const sendData = {
token: configControl.get('config')?.coreConfig?.token,
token: configControl.get()?.coreConfig?.token,
message: msg.toString(),
};
const url = configControl.get('config')?.coreConfig?.coreUrl;
const url = configControl.get()?.coreConfig?.coreUrl;
const returnData = await axios.post(`${url}/api/bot/broadcast`, sendData);
if (returnData?.data?.success) {
return await e.reply(`操作成功:${returnData?.data.data?.toString()}`);

View File

@ -37,7 +37,7 @@ export default class LgrService {
}
const exeFile = path.join(targetDir, 'lgr');
try {
await execAsync(`chmod 777 "${exeFile}"`);
await execAsync(`chmod +777 "${exeFile}"`);
} catch (err) {
logger.error(`[crystelf-admin] chmod 失败: ${err.message}..`);
}