mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 21:10:23 +00:00
fix: adapter api
This commit is contained in:
@@ -30,7 +30,9 @@ export class GetGroupEssence extends BaseAction<Payload, any> {
|
||||
};
|
||||
}
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
async _handle(payload: Payload, adapter: string) {
|
||||
let network = Object.values(this.obContext.configLoader.configData.network) as Array<typeof this.obContext.configLoader.configData.network[keyof typeof this.obContext.configLoader.configData.network]>;
|
||||
let 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) {
|
||||
throw new Error('获取失败');
|
||||
@@ -51,7 +53,7 @@ export class GetGroupEssence extends BaseAction<Payload, any> {
|
||||
operator_nick: msg.add_digest_nick,
|
||||
message_id: message_id,
|
||||
operator_time: msg.add_digest_time,
|
||||
content: (await this.obContext.apis.MsgApi.parseMessage(rawMessage))?.message
|
||||
content: (await this.obContext.apis.MsgApi.parseMessage(rawMessage, msgFormat))?.message
|
||||
};
|
||||
}
|
||||
const msgTempData = JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user