mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 16:00:27 +00:00
Compare commits
8 Commits
copilot/fi
...
v4.9.30
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbb5a0022e | ||
|
|
cb8c8d6b57 | ||
|
|
93c140ed4e | ||
|
|
457b072f0e | ||
|
|
1869493473 | ||
|
|
f33c66ce15 | ||
|
|
e8d6f86458 | ||
|
|
a000ffdf0d |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -15,3 +15,5 @@ devconfig/*
|
|||||||
checkVersion.sh
|
checkVersion.sh
|
||||||
bun.lockb
|
bun.lockb
|
||||||
tests/run/
|
tests/run/
|
||||||
|
guild1.db-wal
|
||||||
|
guild1.db-shm
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"name": "NapCatQQ",
|
"name": "NapCatQQ",
|
||||||
"slug": "NapCat.Framework",
|
"slug": "NapCat.Framework",
|
||||||
"description": "高性能的 OneBot 11 协议实现",
|
"description": "高性能的 OneBot 11 协议实现",
|
||||||
"version": "4.9.27",
|
"version": "4.9.29",
|
||||||
"icon": "./logo.png",
|
"icon": "./logo.png",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "napcat",
|
"name": "napcat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "4.9.27",
|
"version": "4.9.29",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:universal": "npm run build:webui && npm run dev:universal || exit 1",
|
"build:universal": "npm run build:webui && npm run dev:universal || exit 1",
|
||||||
"build:framework": "npm run build:webui && npm run dev:framework || exit 1",
|
"build:framework": "npm run build:webui && npm run dev:framework || exit 1",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export const napCatVersion = '4.9.27';
|
export const napCatVersion = '4.9.29';
|
||||||
|
|||||||
@@ -17,8 +17,14 @@ export class NTQQFriendApi {
|
|||||||
|
|
||||||
async getBuddyV2SimpleInfoMap () {
|
async getBuddyV2SimpleInfoMap () {
|
||||||
const buddyService = this.context.session.getBuddyService();
|
const buddyService = this.context.session.getBuddyService();
|
||||||
|
let uids: string[] = [];
|
||||||
|
if (this.core.context.basicInfoWrapper.requireMinNTQQBuild('41679')) {
|
||||||
|
const buddyListV2NT = await buddyService.getBuddyListV2('0', true, BuddyListReqType.KNOMAL);
|
||||||
|
uids = buddyListV2NT.data.flatMap(item => item.buddyUids);
|
||||||
|
} else {
|
||||||
const buddyListV2 = await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL);
|
const buddyListV2 = await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL);
|
||||||
const uids = buddyListV2.data.flatMap(item => item.buddyUids);
|
uids = buddyListV2.data.flatMap(item => item.buddyUids);
|
||||||
|
}
|
||||||
return await this.core.eventWrapper.callNoListenerEvent(
|
return await this.core.eventWrapper.callNoListenerEvent(
|
||||||
'NodeIKernelProfileService/getCoreAndBaseInfo',
|
'NodeIKernelProfileService/getCoreAndBaseInfo',
|
||||||
'nodeStore',
|
'nodeStore',
|
||||||
@@ -47,10 +53,15 @@ export class NTQQFriendApi {
|
|||||||
|
|
||||||
async getBuddyV2ExWithCate () {
|
async getBuddyV2ExWithCate () {
|
||||||
const buddyService = this.context.session.getBuddyService();
|
const buddyService = this.context.session.getBuddyService();
|
||||||
const buddyListV2 = (await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL)).data;
|
let uids: string[] = [];
|
||||||
const uids = buddyListV2.flatMap(item => {
|
let buddyListV2: Awaited<ReturnType<typeof buddyService.getBuddyListV2>>['data'];
|
||||||
return item.buddyUids;
|
if (this.core.context.basicInfoWrapper.requireMinNTQQBuild('41679')) {
|
||||||
});
|
buddyListV2 = (await buddyService.getBuddyListV2('0', true, BuddyListReqType.KNOMAL)).data;
|
||||||
|
uids = buddyListV2.flatMap(item => item.buddyUids);
|
||||||
|
} else {
|
||||||
|
buddyListV2 = (await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL)).data;
|
||||||
|
uids = buddyListV2.flatMap(item => item.buddyUids);
|
||||||
|
}
|
||||||
const data = await this.core.eventWrapper.callNoListenerEvent(
|
const data = await this.core.eventWrapper.callNoListenerEvent(
|
||||||
'NodeIKernelProfileService/getCoreAndBaseInfo',
|
'NodeIKernelProfileService/getCoreAndBaseInfo',
|
||||||
'nodeStore',
|
'nodeStore',
|
||||||
|
|||||||
@@ -10,9 +10,20 @@ export interface NodeIKernelBuddyService {
|
|||||||
categroyName: string,
|
categroyName: string,
|
||||||
categroyMbCount: number,
|
categroyMbCount: number,
|
||||||
onlineCount: number,
|
onlineCount: number,
|
||||||
buddyUids: Array<string>
|
buddyUids: Array<string>;
|
||||||
}>
|
|
||||||
}>;
|
}>;
|
||||||
|
}>;
|
||||||
|
getBuddyListV2 (callFrom: string, isPullRefresh: boolean, reqType: BuddyListReqType): Promise<GeneralCallResult & {
|
||||||
|
data: Array<{
|
||||||
|
categoryId: number,
|
||||||
|
categorySortId: number,
|
||||||
|
categroyName: string,
|
||||||
|
categroyMbCount: number,
|
||||||
|
onlineCount: number,
|
||||||
|
buddyUids: Array<string>;
|
||||||
|
}>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
getBuddyListFromCache (reqType: BuddyListReqType): Promise<Array<
|
getBuddyListFromCache (reqType: BuddyListReqType): Promise<Array<
|
||||||
{
|
{
|
||||||
@@ -21,7 +32,7 @@ export interface NodeIKernelBuddyService {
|
|||||||
categroyName: string, // 分类名
|
categroyName: string, // 分类名
|
||||||
categroyMbCount: number, // 不懂
|
categroyMbCount: number, // 不懂
|
||||||
onlineCount: number, // 在线数目
|
onlineCount: number, // 在线数目
|
||||||
buddyUids: Array<string>// Uids
|
buddyUids: Array<string>;// Uids
|
||||||
}>>;
|
}>>;
|
||||||
|
|
||||||
addKernelBuddyListener (listener: NodeIKernelBuddyListener): number;
|
addKernelBuddyListener (listener: NodeIKernelBuddyListener): number;
|
||||||
@@ -36,7 +47,7 @@ export interface NodeIKernelBuddyService {
|
|||||||
|
|
||||||
getBuddyRemark (uid: number): string;
|
getBuddyRemark (uid: number): string;
|
||||||
|
|
||||||
setBuddyRemark(param: { uid: string, remark: string, signInfo?: unknown }): void;
|
setBuddyRemark (param: { uid: string, remark: string, signInfo?: unknown; }): void;
|
||||||
|
|
||||||
getAvatarUrl (uid: number): string;
|
getAvatarUrl (uid: number): string;
|
||||||
|
|
||||||
@@ -118,7 +129,7 @@ export interface NodeIKernelBuddyService {
|
|||||||
|
|
||||||
reportDoubtBuddyReqUnread (): void;
|
reportDoubtBuddyReqUnread (): void;
|
||||||
|
|
||||||
getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise<GeneralCallResult & { arkMsg: string }>;
|
getBuddyRecommendContactArkJson (uid: string, phoneNumber: string): Promise<GeneralCallResult & { arkMsg: string; }>;
|
||||||
|
|
||||||
isNull (): boolean;
|
isNull (): boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -37,7 +37,7 @@ export class SendGroupNotice extends OneBotAction<Payload, null> {
|
|||||||
await checkFileExist(path, 5000);
|
await checkFileExist(path, 5000);
|
||||||
const ImageUploadResult = await this.core.apis.GroupApi.uploadGroupBulletinPic(payload.group_id.toString(), path);
|
const ImageUploadResult = await this.core.apis.GroupApi.uploadGroupBulletinPic(payload.group_id.toString(), path);
|
||||||
if (ImageUploadResult.errCode !== 0) {
|
if (ImageUploadResult.errCode !== 0) {
|
||||||
throw new Error(`群公告${payload.image}设置失败,图片上传失败`);
|
throw new Error(`群公告${payload.image}设置失败,图片上传失败 , 错误信息:${ImageUploadResult.errMsg}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
unlink(path).catch(() => { });
|
unlink(path).catch(() => { });
|
||||||
|
|||||||
@@ -1434,8 +1434,7 @@ export class OneBotMsgApi {
|
|||||||
+await this.core.apis.UserApi.getUinByUidV2(groupInvite.invitorUid),
|
+await this.core.apis.UserApi.getUinByUidV2(groupInvite.invitorUid),
|
||||||
'invite',
|
'invite',
|
||||||
'',
|
'',
|
||||||
request_seq,
|
request_seq
|
||||||
+await this.core.apis.UserApi.getUinByUidV2(groupInvite.invitorUid)
|
|
||||||
);
|
);
|
||||||
} else if (SysMessage.contentHead.type === 528 && SysMessage.contentHead.subType === 39 && SysMessage.body?.msgContent) {
|
} else if (SysMessage.contentHead.type === 528 && SysMessage.contentHead.subType === 39 && SysMessage.body?.msgContent) {
|
||||||
return await this.obContext.apis.UserApi.parseLikeEvent(SysMessage.body?.msgContent);
|
return await this.obContext.apis.UserApi.parseLikeEvent(SysMessage.body?.msgContent);
|
||||||
|
|||||||
@@ -9,15 +9,13 @@ export class OB11GroupRequestEvent extends OB11BaseRequestEvent {
|
|||||||
comment: string;
|
comment: string;
|
||||||
flag: string;
|
flag: string;
|
||||||
sub_type: string;
|
sub_type: string;
|
||||||
invitor_id?: number;
|
|
||||||
|
|
||||||
constructor (core: NapCatCore, groupId: number, userId: number, sub_type: string, comment: string, flag: string, invitorId?: number) {
|
constructor (core: NapCatCore, groupId: number, userId: number, sub_type: string, comment: string, flag: string) {
|
||||||
super(core);
|
super(core);
|
||||||
this.group_id = groupId;
|
this.group_id = groupId;
|
||||||
this.user_id = userId;
|
this.user_id = userId;
|
||||||
this.sub_type = sub_type;
|
this.sub_type = sub_type;
|
||||||
this.comment = comment;
|
this.comment = comment;
|
||||||
this.flag = flag;
|
this.flag = flag;
|
||||||
this.invitor_id = invitorId;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -466,15 +466,13 @@ export class NapCatOneBot11Adapter {
|
|||||||
notify.status === GroupNotifyMsgStatus.KUNHANDLE
|
notify.status === GroupNotifyMsgStatus.KUNHANDLE
|
||||||
) {
|
) {
|
||||||
this.context.logger.logDebug(`收到邀请我加群通知:${notify}`);
|
this.context.logger.logDebug(`收到邀请我加群通知:${notify}`);
|
||||||
const inviterUin = +await this.core.apis.UserApi.getUinByUidV2(notify.user2.uid);
|
|
||||||
const groupInviteEvent = new OB11GroupRequestEvent(
|
const groupInviteEvent = new OB11GroupRequestEvent(
|
||||||
this.core,
|
this.core,
|
||||||
+notify.group.groupCode,
|
+notify.group.groupCode,
|
||||||
inviterUin,
|
+await this.core.apis.UserApi.getUinByUidV2(notify.user2.uid),
|
||||||
'invite',
|
'invite',
|
||||||
notify.postscript,
|
notify.postscript,
|
||||||
flag,
|
flag
|
||||||
inviterUin
|
|
||||||
);
|
);
|
||||||
this.networkManager
|
this.networkManager
|
||||||
.emitEvent(groupInviteEvent)
|
.emitEvent(groupInviteEvent)
|
||||||
@@ -490,10 +488,9 @@ export class NapCatOneBot11Adapter {
|
|||||||
this.core,
|
this.core,
|
||||||
+notify.group.groupCode,
|
+notify.group.groupCode,
|
||||||
+await this.core.apis.UserApi.getUinByUidV2(notify.user1.uid),
|
+await this.core.apis.UserApi.getUinByUidV2(notify.user1.uid),
|
||||||
'invite',
|
'add',
|
||||||
notify.postscript,
|
notify.postscript,
|
||||||
flag,
|
flag
|
||||||
+await this.core.apis.UserApi.getUinByUidV2(notify.user2.uid)
|
|
||||||
);
|
);
|
||||||
this.networkManager
|
this.networkManager
|
||||||
.emitEvent(groupInviteEvent)
|
.emitEvent(groupInviteEvent)
|
||||||
|
|||||||
BIN
tests/QQNT.dll
BIN
tests/QQNT.dll
Binary file not shown.
Reference in New Issue
Block a user