mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 16:00:27 +00:00
refactor: emitMsg
This commit is contained in:
@@ -206,3 +206,17 @@ export function migrateOneBotConfigsV1(config: Partial<v1Config>): OneBotConfig
|
||||
}
|
||||
return mergedConfig;
|
||||
}
|
||||
export function getConfigBoolKey(
|
||||
configs: Array<NetworkConfigAdapter>,
|
||||
prediction: (config: NetworkConfigAdapter) => boolean
|
||||
): { positive: Array<string>, negative: Array<string> } {
|
||||
const result: { positive: string[], negative: string[] } = { positive: [], negative: [] };
|
||||
configs.forEach(config => {
|
||||
if (prediction(config)) {
|
||||
result.positive.push(config.name);
|
||||
} else {
|
||||
result.negative.push(config.name);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user