mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
Refactor type handling and improve message parsing
Updated several actions to use more precise type casting and type guards, improving type safety and clarity. Enhanced message parsing logic for forward messages and group/friend message history. Standardized return schemas and error handling for avatar and group portrait actions.
This commit is contained in:
@@ -46,7 +46,7 @@ export default class GoCQHTTPGetGroupMsgHistory extends OneBotAction<PayloadType
|
||||
// 烘焙消息
|
||||
const ob11MsgList = (await Promise.all(
|
||||
msgList.map(msg => this.obContext.apis.MsgApi.parseMessage(msg, config.messagePostFormat, payload.parse_mult_msg, payload.disable_get_url, payload.quick_reply)))
|
||||
).filter(msg => msg !== undefined);
|
||||
return { messages: ob11MsgList as OB11Message[] };
|
||||
).filter((msg): msg is OB11Message => msg !== undefined);
|
||||
return { messages: ob11MsgList };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user