mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-07-04 14:19:19 +00:00
优化
This commit is contained in:
parent
69877be997
commit
893387951a
@ -1,8 +1,9 @@
|
|||||||
import wsClient from '../../models/ws/wsClient.js';
|
import wsClient from '../../models/ws/wsClient.js';
|
||||||
|
import configControl from '../config/configControl.js';
|
||||||
|
|
||||||
const botControl = {
|
const botControl = {
|
||||||
async reportBots() {
|
async reportBots() {
|
||||||
const bots = [];
|
const bots = [{ client: configControl.get('coreConfig').wsClientId }];
|
||||||
|
|
||||||
for (const bot of Object.values(Bot)) {
|
for (const bot of Object.values(Bot)) {
|
||||||
if (!bot || !bot.uin) continue;
|
if (!bot || !bot.uin) continue;
|
||||||
@ -11,6 +12,7 @@ const botControl = {
|
|||||||
uin: bot.uin,
|
uin: bot.uin,
|
||||||
groups: [],
|
groups: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
let groupsMap = bot.gl;
|
let groupsMap = bot.gl;
|
||||||
if (groupsMap) {
|
if (groupsMap) {
|
||||||
for (const [groupId, groupInfo] of groupsMap) {
|
for (const [groupId, groupInfo] of groupsMap) {
|
||||||
@ -20,13 +22,16 @@ const botControl = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bots.push(botInfo);
|
bots.push(botInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await wsClient.sendMessage({
|
const message = {
|
||||||
type: 'reportBots',
|
type: 'reportBots',
|
||||||
data: bots,
|
data: bots,
|
||||||
});
|
};
|
||||||
|
|
||||||
|
return await wsClient.sendMessage(message);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user