diff --git a/manifest.json b/manifest.json index 91bb7bff..2f8aa4d1 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "NapCatQQ", "slug": "NapCat.Framework", "description": "高性能的 OneBot 11 协议实现", - "version": "2.5.1", + "version": "2.5.3", "icon": "./logo.png", "authors": [ { diff --git a/package.json b/package.json index d7248fe2..57cc6eda 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "2.5.1", + "version": "2.5.3", "scripts": { "build:framework": "vite build --mode framework", "build:shell": "vite build --mode shell", diff --git a/src/common/helper.ts b/src/common/helper.ts index 198c44da..6b281f62 100644 --- a/src/common/helper.ts +++ b/src/common/helper.ts @@ -163,8 +163,17 @@ export function isEqual(obj1: any, obj2: any) { export function getDefaultQQVersionConfigInfo(): QQVersionConfigType { if (os.platform() === 'linux') { return { - baseVersion: '3.2.12-27597', - curVersion: '3.2.12-27597', + baseVersion: '3.2.12.27254', + curVersion: '3.2.12.27254', + prevVersion: '', + onErrorVersions: [], + buildId: '27254', + }; + } + if (os.platform() === 'darwin') { + return { + baseVersion: '6.9.53.27597', + curVersion: '6.9.53.27597', prevVersion: '', onErrorVersions: [], buildId: '27597', diff --git a/src/common/qq-basic-info.ts b/src/common/qq-basic-info.ts index 91570676..857572fc 100644 --- a/src/common/qq-basic-info.ts +++ b/src/common/qq-basic-info.ts @@ -61,6 +61,12 @@ export class QQBasicInfoWrapper { return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; default: return `V1_WIN_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; + case 'linux': + return `V1_LNX_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; + case 'darwin': + return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; + default: + return `V1_WIN_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; } } diff --git a/src/common/version.ts b/src/common/version.ts index 60516350..85b145aa 100644 --- a/src/common/version.ts +++ b/src/common/version.ts @@ -1 +1 @@ -export const napCatVersion = '2.5.1'; +export const napCatVersion = '2.5.3'; diff --git a/src/core/external/appid.json b/src/core/external/appid.json index 50d410db..cdc03108 100644 --- a/src/core/external/appid.json +++ b/src/core/external/appid.json @@ -1,4 +1,14 @@ { + + "3.2.12-27254":{ + "appid": 537240795, + "qua": "V1_LNX_NQ_3.2.12_27254_GW_B" + }, + "9.9.15-27254":{ + "appid": 537240709, + "qua": "V1_WIN_NQ_9.9.15_27254_GW_B" + }, + "3.2.12-27597": { "appid": 537243600, "qua": "V1_LNX_NQ_3.2.12_27597_GW_B" @@ -11,6 +21,7 @@ "appid": 537243538, "qua": "V1_MAC_NQ_6.9.53_27597_GW_B" }, + "9.9.15-28060":{ "appid": 537246092, "qua": "V1_WIN_NQ_9.9.15_28060_GW_B" diff --git a/src/core/services/NodeIKernelBuddyService.ts b/src/core/services/NodeIKernelBuddyService.ts index 9273d05d..ac96b5a3 100644 --- a/src/core/services/NodeIKernelBuddyService.ts +++ b/src/core/services/NodeIKernelBuddyService.ts @@ -114,7 +114,7 @@ export interface NodeIKernelBuddyService { reportDoubtBuddyReqUnread(): void; - getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise; + getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise; isNull(): boolean; } diff --git a/src/onebot/action/extends/FetchOtherProfileLike.ts b/src/onebot/action/extends/FetchOtherProfileLike.ts new file mode 100644 index 00000000..820542fa --- /dev/null +++ b/src/onebot/action/extends/FetchOtherProfileLike.ts @@ -0,0 +1,11 @@ +import BaseAction from '../BaseAction'; +import { ActionName } from '../types'; + +export class FetchOtherProfileLike extends BaseAction<{ qq: number }, any> { + actionName = ActionName.FetchOtherProfileLike; + + async _handle(payload: { qq: number }) { + if (!payload.qq) throw new Error('qq is required'); + return await this.core.apis.UserApi.getUidByUinV2(payload.qq.toString()); + } +} diff --git a/src/onebot/action/index.ts b/src/onebot/action/index.ts index c55e9b0a..d8f1f13f 100644 --- a/src/onebot/action/index.ts +++ b/src/onebot/action/index.ts @@ -84,6 +84,7 @@ import { GetGroupFileSystemInfo } from '@/onebot/action/go-cqhttp/GetGroupFileSy import { GetGroupRootFiles } from '@/onebot/action/go-cqhttp/GetGroupRootFiles'; import { GetGroupFilesByFolder } from '@/onebot/action/go-cqhttp/GetGroupFilesByFolder'; import { GetGroupSystemMsg } from './system/GetSystemMsg'; +import { FetchOtherProfileLike } from './extends/fetchOtherProfileLike'; export type ActionMap = Map>; @@ -178,6 +179,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo new GetGroupFileSystemInfo(obContext, core), new GetGroupFilesByFolder(obContext, core), new GetGroupSystemMsg(obContext, core), + new FetchOtherProfileLike(obContext, core), ]; const actionMap = new Map(); for (const action of actionHandlers) { diff --git a/src/onebot/action/types.ts b/src/onebot/action/types.ts index 54d8cd68..0cc7644a 100644 --- a/src/onebot/action/types.ts +++ b/src/onebot/action/types.ts @@ -118,4 +118,5 @@ export enum ActionName { DelGroupNotice = '_del_group_notice', GetGroupInfoEx = "get_group_info_ex", GetGroupSystemMsg = 'get_group_system_msg', + FetchOtherProfileLike = "fetch_other_profile_like", } diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index c8090c0b..4f056038 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -607,6 +607,14 @@ export class OneBotMsgApi { }), [OB11MessageDataType.miniapp]: async () => undefined, + + [OB11MessageDataType.contact]: async ({ data }, context) => { + let arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(data.qq, ''); + return this.ob11ToRawConverters.json({ + data: { data: arkJson.arkMsg }, + type: OB11MessageDataType.json + }, context); + } }; constructor(obContext: NapCatOneBot11Adapter, core: NapCatCore) { diff --git a/src/onebot/types/message.ts b/src/onebot/types/message.ts index bf2f3530..1386aa52 100644 --- a/src/onebot/types/message.ts +++ b/src/onebot/types/message.ts @@ -62,6 +62,7 @@ export enum OB11MessageDataType { dice = 'dice', RPS = 'rps', miniapp = 'miniapp',//json类 + contact = 'contact', Location = 'location' } @@ -81,10 +82,15 @@ export interface OB11MessageText { text: string, // 纯文本 } } - +export interface OB11MessageContext { + type: OB11MessageDataType.contact, + data: { + qq: string, + } +} export interface OB11MessageFileBase { data: { - file_unique?:string, + file_unique?: string, path?: string; thumb?: string; name?: string; @@ -198,7 +204,7 @@ export type OB11MessageData = OB11MessageAt | OB11MessageReply | OB11MessageImage | OB11MessageRecord | OB11MessageFile | OB11MessageVideo | OB11MessageNode | OB11MessageIdMusic | OB11MessageCustomMusic | OB11MessageJson | - OB11MessageDice | OB11MessageRPS | OB11MessageMarkdown | OB11MessageForward + OB11MessageDice | OB11MessageRPS | OB11MessageMarkdown | OB11MessageForward | OB11MessageContext export interface OB11PostSendMsg { message_type?: 'private' | 'group' diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index ef87090a..c7deba23 100644 --- a/src/webui/ui/NapCat.ts +++ b/src/webui/ui/NapCat.ts @@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) { SettingItem( 'Napcat', undefined, - SettingButton('V2.5.1', 'napcat-update-button', 'secondary'), + SettingButton('V2.5.3', 'napcat-update-button', 'secondary'), ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index fa3d67e8..51296347 100644 --- a/static/assets/renderer.js +++ b/static/assets/renderer.js @@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) { SettingItem( 'Napcat', void 0, - SettingButton("V2.5.1", "napcat-update-button", "secondary") + SettingButton("V2.5.3", "napcat-update-button", "secondary") ) ]), SettingList([