style: 强类型大法

This commit is contained in:
手瓜一十雪
2025-02-02 23:22:21 +08:00
parent ac193cc94a
commit 15854c605b
191 changed files with 923 additions and 806 deletions

View File

@@ -10,16 +10,16 @@ const SchemaData = Type.Object({
type Payload = Static<typeof SchemaData>;
export default class GetRecentContact extends OneBotAction<Payload, any> {
actionName = ActionName.GetRecentContact;
payloadSchema = SchemaData;
export default class GetRecentContact extends OneBotAction<Payload, unknown> {
override actionName = ActionName.GetRecentContact;
override payloadSchema = SchemaData;
async _handle(payload: Payload, adapter: string, config: NetworkAdapterConfig) {
async _handle(payload: Payload, _adapter: string, config: NetworkAdapterConfig) {
const ret = await this.core.apis.UserApi.getRecentContactListSnapShot(+payload.count);
//烘焙消息
return await Promise.all(ret.info.changedList.map(async (t) => {
const FastMsg = await this.core.apis.MsgApi.getMsgsByMsgId({ chatType: t.chatType, peerUid: t.peerUid }, [t.msgId]);
if (FastMsg.msgList.length > 0) {
if (FastMsg.msgList.length > 0 && FastMsg.msgList[0]) {
//扩展ret.info.changedList
const lastestMsg = await this.obContext.apis.MsgApi.parseMessage(FastMsg.msgList[0], config.messagePostFormat);
return {