Merge branch 'main' into 28060

This commit is contained in:
手瓜一十雪 2024-09-16 18:52:32 +08:00
commit 85c9227515
14 changed files with 65 additions and 11 deletions

View File

@ -4,7 +4,7 @@
"name": "NapCatQQ", "name": "NapCatQQ",
"slug": "NapCat.Framework", "slug": "NapCat.Framework",
"description": "高性能的 OneBot 11 协议实现", "description": "高性能的 OneBot 11 协议实现",
"version": "2.5.1", "version": "2.5.3",
"icon": "./logo.png", "icon": "./logo.png",
"authors": [ "authors": [
{ {

View File

@ -2,7 +2,7 @@
"name": "napcat", "name": "napcat",
"private": true, "private": true,
"type": "module", "type": "module",
"version": "2.5.1", "version": "2.5.3",
"scripts": { "scripts": {
"build:framework": "vite build --mode framework", "build:framework": "vite build --mode framework",
"build:shell": "vite build --mode shell", "build:shell": "vite build --mode shell",

View File

@ -163,8 +163,17 @@ export function isEqual(obj1: any, obj2: any) {
export function getDefaultQQVersionConfigInfo(): QQVersionConfigType { export function getDefaultQQVersionConfigInfo(): QQVersionConfigType {
if (os.platform() === 'linux') { if (os.platform() === 'linux') {
return { return {
baseVersion: '3.2.12-27597', baseVersion: '3.2.12.27254',
curVersion: '3.2.12-27597', 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: '', prevVersion: '',
onErrorVersions: [], onErrorVersions: [],
buildId: '27597', buildId: '27597',

View File

@ -61,6 +61,12 @@ export class QQBasicInfoWrapper {
return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`;
default: default:
return `V1_WIN_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; 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`;
} }
} }

View File

@ -1 +1 @@
export const napCatVersion = '2.5.1'; export const napCatVersion = '2.5.3';

View File

@ -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": { "3.2.12-27597": {
"appid": 537243600, "appid": 537243600,
"qua": "V1_LNX_NQ_3.2.12_27597_GW_B" "qua": "V1_LNX_NQ_3.2.12_27597_GW_B"
@ -11,6 +21,7 @@
"appid": 537243538, "appid": 537243538,
"qua": "V1_MAC_NQ_6.9.53_27597_GW_B" "qua": "V1_MAC_NQ_6.9.53_27597_GW_B"
}, },
"9.9.15-28060":{ "9.9.15-28060":{
"appid": 537246092, "appid": 537246092,
"qua": "V1_WIN_NQ_9.9.15_28060_GW_B" "qua": "V1_WIN_NQ_9.9.15_28060_GW_B"

View File

@ -114,7 +114,7 @@ export interface NodeIKernelBuddyService {
reportDoubtBuddyReqUnread(): void; reportDoubtBuddyReqUnread(): void;
getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise<unknown>; getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise<GeneralCallResult & { arkMsg: string }>;
isNull(): boolean; isNull(): boolean;
} }

View File

@ -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());
}
}

View File

@ -84,6 +84,7 @@ import { GetGroupFileSystemInfo } from '@/onebot/action/go-cqhttp/GetGroupFileSy
import { GetGroupRootFiles } from '@/onebot/action/go-cqhttp/GetGroupRootFiles'; import { GetGroupRootFiles } from '@/onebot/action/go-cqhttp/GetGroupRootFiles';
import { GetGroupFilesByFolder } from '@/onebot/action/go-cqhttp/GetGroupFilesByFolder'; import { GetGroupFilesByFolder } from '@/onebot/action/go-cqhttp/GetGroupFilesByFolder';
import { GetGroupSystemMsg } from './system/GetSystemMsg'; import { GetGroupSystemMsg } from './system/GetSystemMsg';
import { FetchOtherProfileLike } from './extends/fetchOtherProfileLike';
export type ActionMap = Map<string, BaseAction<any, any>>; export type ActionMap = Map<string, BaseAction<any, any>>;
@ -178,6 +179,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
new GetGroupFileSystemInfo(obContext, core), new GetGroupFileSystemInfo(obContext, core),
new GetGroupFilesByFolder(obContext, core), new GetGroupFilesByFolder(obContext, core),
new GetGroupSystemMsg(obContext, core), new GetGroupSystemMsg(obContext, core),
new FetchOtherProfileLike(obContext, core),
]; ];
const actionMap = new Map(); const actionMap = new Map();
for (const action of actionHandlers) { for (const action of actionHandlers) {

View File

@ -118,4 +118,5 @@ export enum ActionName {
DelGroupNotice = '_del_group_notice', DelGroupNotice = '_del_group_notice',
GetGroupInfoEx = "get_group_info_ex", GetGroupInfoEx = "get_group_info_ex",
GetGroupSystemMsg = 'get_group_system_msg', GetGroupSystemMsg = 'get_group_system_msg',
FetchOtherProfileLike = "fetch_other_profile_like",
} }

View File

@ -607,6 +607,14 @@ export class OneBotMsgApi {
}), }),
[OB11MessageDataType.miniapp]: async () => undefined, [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) { constructor(obContext: NapCatOneBot11Adapter, core: NapCatCore) {

View File

@ -62,6 +62,7 @@ export enum OB11MessageDataType {
dice = 'dice', dice = 'dice',
RPS = 'rps', RPS = 'rps',
miniapp = 'miniapp',//json类 miniapp = 'miniapp',//json类
contact = 'contact',
Location = 'location' Location = 'location'
} }
@ -81,10 +82,15 @@ export interface OB11MessageText {
text: string, // 纯文本 text: string, // 纯文本
} }
} }
export interface OB11MessageContext {
type: OB11MessageDataType.contact,
data: {
qq: string,
}
}
export interface OB11MessageFileBase { export interface OB11MessageFileBase {
data: { data: {
file_unique?:string, file_unique?: string,
path?: string; path?: string;
thumb?: string; thumb?: string;
name?: string; name?: string;
@ -198,7 +204,7 @@ export type OB11MessageData =
OB11MessageAt | OB11MessageReply | OB11MessageAt | OB11MessageReply |
OB11MessageImage | OB11MessageRecord | OB11MessageFile | OB11MessageVideo | OB11MessageImage | OB11MessageRecord | OB11MessageFile | OB11MessageVideo |
OB11MessageNode | OB11MessageIdMusic | OB11MessageCustomMusic | OB11MessageJson | OB11MessageNode | OB11MessageIdMusic | OB11MessageCustomMusic | OB11MessageJson |
OB11MessageDice | OB11MessageRPS | OB11MessageMarkdown | OB11MessageForward OB11MessageDice | OB11MessageRPS | OB11MessageMarkdown | OB11MessageForward | OB11MessageContext
export interface OB11PostSendMsg { export interface OB11PostSendMsg {
message_type?: 'private' | 'group' message_type?: 'private' | 'group'

View File

@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) {
SettingItem( SettingItem(
'<span id="napcat-update-title">Napcat</span>', '<span id="napcat-update-title">Napcat</span>',
undefined, undefined,
SettingButton('V2.5.1', 'napcat-update-button', 'secondary'), SettingButton('V2.5.3', 'napcat-update-button', 'secondary'),
), ),
]), ]),
SettingList([ SettingList([

View File

@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) {
SettingItem( SettingItem(
'<span id="napcat-update-title">Napcat</span>', '<span id="napcat-update-title">Napcat</span>',
void 0, void 0,
SettingButton("V2.5.1", "napcat-update-button", "secondary") SettingButton("V2.5.3", "napcat-update-button", "secondary")
) )
]), ]),
SettingList([ SettingList([