mirror of
https://github.com/crystelf/crystelf-admin.git
synced 2025-12-05 13:41:57 +00:00
fix:修复配置问题
This commit is contained in:
parent
edad447c6e
commit
6c14830af3
@ -26,13 +26,13 @@ export default class ReportBots extends plugin {
|
|||||||
|
|
||||||
async autoReport() {
|
async autoReport() {
|
||||||
logger.mark(`[crystelf-admin] 正在自动同步bot数据到晶灵核心..`);
|
logger.mark(`[crystelf-admin] 正在自动同步bot数据到晶灵核心..`);
|
||||||
if (configControl.get('core')) {
|
if (configControl.get('config')?.core) {
|
||||||
await botControl.reportBots();
|
await botControl.reportBots();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async manualReport(e) {
|
async manualReport(e) {
|
||||||
if (!configControl.get('core')) {
|
if (!configControl.get('config')?.core) {
|
||||||
return e.reply(`[crystelf-admin] 晶灵核心未启用..`, true);
|
return e.reply(`[crystelf-admin] 晶灵核心未启用..`, true);
|
||||||
}
|
}
|
||||||
let success = await botControl.reportBots();
|
let success = await botControl.reportBots();
|
||||||
@ -51,10 +51,10 @@ export default class ReportBots extends plugin {
|
|||||||
await e.reply(`开始广播消息到所有群..`);
|
await e.reply(`开始广播消息到所有群..`);
|
||||||
try {
|
try {
|
||||||
const sendData = {
|
const sendData = {
|
||||||
token: configControl.get('coreConfig')?.token,
|
token: configControl.get('config')?.coreConfig?.token,
|
||||||
message: msg.toString(),
|
message: msg.toString(),
|
||||||
};
|
};
|
||||||
const url = configControl.get('coreConfig')?.coreUrl;
|
const url = configControl.get('config')?.coreConfig?.coreUrl;
|
||||||
const returnData = await axios.post(`${url}/api/bot/broadcast`, sendData);
|
const returnData = await axios.post(`${url}/api/bot/broadcast`, sendData);
|
||||||
if (returnData?.data?.success) {
|
if (returnData?.data?.success) {
|
||||||
return await e.reply(`操作成功:${returnData?.data.data?.toString()}`);
|
return await e.reply(`操作成功:${returnData?.data.data?.toString()}`);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user