This commit is contained in:
Jerry 2025-04-28 17:53:50 +08:00
parent 69877be997
commit 893387951a
2 changed files with 8 additions and 3 deletions

View File

View File

@ -1,8 +1,9 @@
import wsClient from '../../models/ws/wsClient.js';
import configControl from '../config/configControl.js';
const botControl = {
async reportBots() {
const bots = [];
const bots = [{ client: configControl.get('coreConfig').wsClientId }];
for (const bot of Object.values(Bot)) {
if (!bot || !bot.uin) continue;
@ -11,6 +12,7 @@ const botControl = {
uin: bot.uin,
groups: [],
};
let groupsMap = bot.gl;
if (groupsMap) {
for (const [groupId, groupInfo] of groupsMap) {
@ -20,13 +22,16 @@ const botControl = {
});
}
}
bots.push(botInfo);
}
return await wsClient.sendMessage({
const message = {
type: 'reportBots',
data: bots,
});
};
return await wsClient.sendMessage(message);
},
};