Skip to content

Commit

Permalink
release: 2.2.20
Browse files Browse the repository at this point in the history
  • Loading branch information
MliKiowa committed Aug 28, 2024
1 parent 2722ca2 commit 03a298a
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 25 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "NapCatQQ",
"slug": "NapCat.Framework",
"description": "高性能的 OneBot 11 协议实现",
"version": "2.2.19",
"version": "2.2.20",
"icon": "./logo.png",
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "napcat",
"private": true,
"type": "module",
"version": "2.2.19",
"version": "2.2.20",
"scripts": {
"build:framework": "vite build --mode framework",
"build:shell": "vite build --mode shell",
Expand Down
2 changes: 1 addition & 1 deletion src/common/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const napCatVersion = '2.2.19';
export const napCatVersion = '2.2.20';
5 changes: 0 additions & 5 deletions src/core/apis/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ export class NTQQGroupApi {
}
this.context.logger.logDebug(`加载${this.groups.length}个群组缓存完成`);
}
async getGroupInfoEx(groupCode: string) {
const groupDetail = await this.context.session.getGroupService().getGroupDetailInfo(groupCode, GroupInfoSource.KDATACARD);
const groupExtInfo = await this.getGroupExtFE0Info([groupCode]);
return { groupDetail, groupExtInfo };
}
async setGroupAvatar(gc: string, filePath: string) {
return this.context.session.getGroupService().setHeader(gc, filePath);
}
Expand Down
20 changes: 6 additions & 14 deletions src/core/services/NodeIKernelGroupService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { GeneralCallResult } from '@/core/services/common';
//高版本的接口不应该随意使用 使用应该严格进行pr审核 同时部分ipc中未出现的接口不要过于依赖 应该做好数据兜底

export interface NodeIKernelGroupService {
//getGroupExt0xEF0Info(this.$enableGroupCodes, this.$bannedGroupCodes, this.$filter, this.$forceFetch
getGroupExt0xEF0Info(enableGroupCodes: string[], bannedGroupCodes: string[], filter: GroupExt0xEF0InfoFilter, forceFetch: boolean):
Promise<GeneralCallResult & { result: { groupExtInfos: Map<string, any> } }>;

kickMemberV2(param: KickMemberV2Req): Promise<GeneralCallResult>;

quitGroupV2(param: { groupCode: string; needDeleteLocalMsg: boolean; }): Promise<GeneralCallResult>;
Expand All @@ -40,11 +40,11 @@ export interface NodeIKernelGroupService {
realSpecialTitleFlag: number
}): Promise<unknown>;

//26702
getGroupMemberLevelInfo(groupCode: string): Promise<unknown>;

//26702
getGroupHonorList(groupCodes: Array<string>): unknown;
getGroupInfoForJoinGroup(groupCode: string, needPrivilegeFlag: boolean, serviceType: number): Promise<unknown>;

getGroupHonorList(req: { groupCodes: Array<string> }): Promise<unknown>;

getUinByUids(uins: string[]): Promise<{
errCode: number,
Expand All @@ -58,13 +58,10 @@ export interface NodeIKernelGroupService {
uids: Map<string, string>
}>;

//26702(其实更早 但是我不知道)
checkGroupMemberCache(arrayList: Array<string>): Promise<unknown>;

//26702(其实更早 但是我不知道)
getGroupLatestEssenceList(groupCode: string): Promise<unknown>;

//26702(其实更早 但是我不知道)
shareDigest(Req: {
appId: string,
appType: number,
Expand All @@ -84,20 +81,17 @@ export interface NodeIKernelGroupService {
}
}): Promise<unknown>;

//26702(其实更早 但是我不知道)

isEssenceMsg(Req: { groupCode: string, msgRandom: number, msgSeq: number }): Promise<unknown>;

//26702(其实更早 但是我不知道)
queryCachedEssenceMsg(Req: { groupCode: string, msgRandom: number, msgSeq: number }): Promise<unknown>;

//26702(其实更早 但是我不知道)
fetchGroupEssenceList(Req: {
groupCode: string,
pageStart: number,
pageLimit: number
}, Arg: unknown): Promise<unknown>;

//26702
getAllMemberList(groupCode: string, forceFetch: boolean): Promise<{
errCode: number,
errMsg: string,
Expand Down Expand Up @@ -136,8 +130,6 @@ export interface NodeIKernelGroupService {

getMemberInfo(group_id: string, uids: string[], forceFetch: boolean): Promise<GeneralCallResult>;

//getMemberInfo [ '56729xxxx', [ 'u_4Nj08cwW5Hxxxxx' ], true ]

kickMember(groupCode: string, memberUids: string[], refuseForever: boolean, kickReason: string): Promise<void>;

modifyMemberRole(groupCode: string, uid: string, role: GroupMemberRole): void;
Expand All @@ -152,7 +144,7 @@ export interface NodeIKernelGroupService {

getGroupExtList(force: boolean): Promise<GeneralCallResult>;

getGroupDetailInfo(groupCode: string, groupInfoSource: GroupInfoSource): unknown;
getGroupDetailInfo(groupCode: string, groupInfoSource: GroupInfoSource): Promise<unknown>;

getMemberExtInfo(param: GroupExtParam): Promise<unknown>;//req

Expand Down
24 changes: 24 additions & 0 deletions src/onebot/action/extends/GetGroupInfoEx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';

const SchemaData = {
type: 'object',
properties: {
group_id: { type: ['number', 'string'] },
},
required: ['group_id'],
} as const satisfies JSONSchema;

type Payload = FromSchema<typeof SchemaData>;

export class GetGroupInfoEx extends BaseAction<Payload, any> {
actionName = ActionName.GetGroupInfoEx;
payloadSchema = SchemaData;

async _handle(payload: Payload) {
const NTQQGroupApi = this.core.apis.GroupApi;
const groupInfoEx = (await NTQQGroupApi.getGroupExtFE0Info([payload.group_id.toString()])).result.groupExtInfos.get(payload.group_id.toString());
return groupInfoEx;
}
}
2 changes: 2 additions & 0 deletions src/onebot/action/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ import SetModelShow from './go-cqhttp/SetModelShow';
import { SetInputStatus } from './extends/SetInputStatus';
import { GetCSRF } from './system/GetCSRF';
import { DelGroupNotice } from './group/DelGroupNotice';
import { GetGroupInfoEx } from './extends/GetGroupInfoEx';

export type ActionMap = Map<string, BaseAction<any, any>>;

export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore): ActionMap {
const actionHandlers = [
new GetGroupInfoEx(obContext, core),
new FetchEmojiLike(obContext, core),
new GetFile(obContext, core),
new SetQQProfile(obContext, core),
Expand Down
1 change: 1 addition & 0 deletions src/onebot/action/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ export enum ActionName {
SetInputStatus = 'set_input_status',
GetCSRF = 'get_csrf_token',
DelGroupNotice = '_del_group_notice',
GetGroupInfoEx = "get_group_info_ex"
}
2 changes: 1 addition & 1 deletion src/onebot/config/onebot11.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"http": {
"enable": true,
"enable": false,
"host": "",
"port": 3000,
"secret": "",
Expand Down
2 changes: 1 addition & 1 deletion src/webui/ui/NapCat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) {
SettingItem(
'<span id="napcat-update-title">Napcat</span>',
undefined,
SettingButton('V2.2.19', 'napcat-update-button', 'secondary'),
SettingButton('V2.2.20', 'napcat-update-button', 'secondary'),
),
]),
SettingList([
Expand Down
2 changes: 1 addition & 1 deletion static/assets/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) {
SettingItem(
'<span id="napcat-update-title">Napcat</span>',
void 0,
SettingButton("V2.2.19", "napcat-update-button", "secondary")
SettingButton("V2.2.20", "napcat-update-button", "secondary")
)
]),
SettingList([
Expand Down

0 comments on commit 03a298a

Please sign in to comment.