mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 08:10:25 +00:00
refactor: AdapterConfig
This commit is contained in:
@@ -4,6 +4,7 @@ import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
import crypto from 'crypto';
|
||||
import { AdapterConfigWrap } from '@/onebot/config/config';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
@@ -31,7 +32,7 @@ export class GetGroupEssence extends BaseAction<Payload, any> {
|
||||
}
|
||||
|
||||
async _handle(payload: Payload, adapter: string) {
|
||||
const network = Object.values(this.obContext.configLoader.configData.network) as Array<typeof this.obContext.configLoader.configData.network[keyof typeof this.obContext.configLoader.configData.network]>;
|
||||
const network = Object.values(this.obContext.configLoader.configData.network) as Array<AdapterConfigWrap>;
|
||||
const msgFormat = network.flat().find(e => e.name === adapter)?.messagePostFormat ?? 'array';
|
||||
const msglist = (await this.core.apis.WebApi.getGroupEssenceMsgAll(payload.group_id.toString())).flatMap((e) => e.data.msg_list);
|
||||
if (!msglist) {
|
||||
|
||||
Reference in New Issue
Block a user