mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
release: 1.6.7
This commit is contained in:
@@ -21,5 +21,6 @@ QQ Version: Windows 9.9.12-26000 / Linux 3.2.9-26000
|
|||||||
4. 新增最近联系列表API(RAW 不稳定)
|
4. 新增最近联系列表API(RAW 不稳定)
|
||||||
5. 上报群精华设置事件
|
5. 上报群精华设置事件
|
||||||
6. 新增设置所有消息已读API(非标准)
|
6. 新增设置所有消息已读API(非标准)
|
||||||
|
7. 新增获取点赞信息获取API(非标准)
|
||||||
|
|
||||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"name": "napcat",
|
"name": "napcat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.6.6",
|
"version": "1.6.7",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch:dev": "vite --mode development",
|
"watch:dev": "vite --mode development",
|
||||||
"watch:prod": "vite --mode production",
|
"watch:prod": "vite --mode production",
|
||||||
|
@@ -35,6 +35,20 @@ setTimeout(() => {
|
|||||||
// }
|
// }
|
||||||
// };
|
// };
|
||||||
export class NTQQUserApi {
|
export class NTQQUserApi {
|
||||||
|
static async getProfileLike(uin: string) {
|
||||||
|
return napCatCore.session.getProfileLikeService().getBuddyProfileLike( {
|
||||||
|
"friendUids": [
|
||||||
|
"u_FUSS0_x06S_9Tf4na_WpUg"
|
||||||
|
],
|
||||||
|
"basic": 1,
|
||||||
|
"vote": 1,
|
||||||
|
"favorite": 0,
|
||||||
|
"userProfile": 1,
|
||||||
|
"type": 2,
|
||||||
|
"start": 0,
|
||||||
|
"limit": 20
|
||||||
|
});
|
||||||
|
}
|
||||||
static async setLongNick(longNick: string) {
|
static async setLongNick(longNick: string) {
|
||||||
return napCatCore.session.getProfileService().setLongNick(longNick);
|
return napCatCore.session.getProfileService().setLongNick(longNick);
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import { BuddyProfileLikeReq } from "../entities/user";
|
import { BuddyProfileLikeReq } from "../entities/user";
|
||||||
|
import { GeneralCallResult } from "./common";
|
||||||
|
|
||||||
export interface NodeIKernelProfileLikeService {
|
export interface NodeIKernelProfileLikeService {
|
||||||
addKernelProfileLikeListener(listener: NodeIKernelProfileLikeService): void;
|
addKernelProfileLikeListener(listener: NodeIKernelProfileLikeService): void;
|
||||||
@@ -7,7 +8,13 @@ export interface NodeIKernelProfileLikeService {
|
|||||||
|
|
||||||
setBuddyProfileLike(...args: unknown[]): { result: number, errMsg: string, succCounts: number };
|
setBuddyProfileLike(...args: unknown[]): { result: number, errMsg: string, succCounts: number };
|
||||||
|
|
||||||
getBuddyProfileLike(req: BuddyProfileLikeReq): void;
|
getBuddyProfileLike(req: BuddyProfileLikeReq): Promise<GeneralCallResult & {
|
||||||
|
"info": {
|
||||||
|
"userLikeInfos": Array<any>,
|
||||||
|
"friendMaxVotes": number,
|
||||||
|
"start": number
|
||||||
|
}
|
||||||
|
}>;
|
||||||
|
|
||||||
getProfileLikeScidResourceInfo(...args: unknown[]): void;
|
getProfileLikeScidResourceInfo(...args: unknown[]): void;
|
||||||
|
|
||||||
|
@@ -30,5 +30,6 @@ export interface NodeIKernelRobotService {
|
|||||||
setRobotPickTts(arg1: unknown, arg2: unknown): unknown;
|
setRobotPickTts(arg1: unknown, arg2: unknown): unknown;
|
||||||
|
|
||||||
getRobotUinRange(data: any): Promise<{ response: { robotUinRanges: any } }>
|
getRobotUinRange(data: any): Promise<{ response: { robotUinRanges: any } }>
|
||||||
|
|
||||||
isNull(): boolean;
|
isNull(): boolean;
|
||||||
}
|
}
|
||||||
|
24
src/onebot11/action/extends/GetProfileLike.ts
Normal file
24
src/onebot11/action/extends/GetProfileLike.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import BaseAction from '../BaseAction';
|
||||||
|
import { ActionName } from '../types';
|
||||||
|
import { NTQQUserApi } from '@/core/apis';
|
||||||
|
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||||
|
const SchemaData = {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
user_id: {
|
||||||
|
type: ['number', 'string']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
required: ['user_id'],
|
||||||
|
} as const satisfies JSONSchema;
|
||||||
|
|
||||||
|
type Payload = FromSchema<typeof SchemaData>;
|
||||||
|
|
||||||
|
export class GetProfileLike extends BaseAction<Payload, any> {
|
||||||
|
actionName = ActionName.GetProfileLike;
|
||||||
|
PayloadSchema = SchemaData;
|
||||||
|
protected async _handle(payload: Payload) {
|
||||||
|
const ret = await NTQQUserApi.getProfileLike((await NTQQUserApi.getUidByUin(payload.user_id.toString()))!);
|
||||||
|
return ret.info;
|
||||||
|
}
|
||||||
|
}
|
@@ -73,6 +73,7 @@ import { SetLongNick } from './extends/SetLongNick';
|
|||||||
import DelEssenceMsg from './group/DelEssenceMsg';
|
import DelEssenceMsg from './group/DelEssenceMsg';
|
||||||
import SetEssenceMsg from './group/SetEssenceMsg';
|
import SetEssenceMsg from './group/SetEssenceMsg';
|
||||||
import GetRecentContact from './user/GetRecentContact';
|
import GetRecentContact from './user/GetRecentContact';
|
||||||
|
import { GetProfileLike } from './extends/GetProfileLike';
|
||||||
|
|
||||||
export const actionHandlers = [
|
export const actionHandlers = [
|
||||||
new RebootNormal(),
|
new RebootNormal(),
|
||||||
@@ -154,7 +155,8 @@ export const actionHandlers = [
|
|||||||
new DelEssenceMsg(),
|
new DelEssenceMsg(),
|
||||||
new SetEssenceMsg(),
|
new SetEssenceMsg(),
|
||||||
new GetRecentContact(),
|
new GetRecentContact(),
|
||||||
new MarkAllMsgAsRead()
|
new MarkAllMsgAsRead(),
|
||||||
|
new GetProfileLike()
|
||||||
];
|
];
|
||||||
|
|
||||||
function initActionMap() {
|
function initActionMap() {
|
||||||
|
@@ -97,5 +97,6 @@ export enum ActionName {
|
|||||||
SetEssenceMsg = "set_essence_msg",
|
SetEssenceMsg = "set_essence_msg",
|
||||||
DelEssenceMsg = "delete_essence_msg",
|
DelEssenceMsg = "delete_essence_msg",
|
||||||
GetRecentContact = "get_recent_contact",
|
GetRecentContact = "get_recent_contact",
|
||||||
_MarkAllMsgAsRead = "_mark_all_as_read"
|
_MarkAllMsgAsRead = "_mark_all_as_read",
|
||||||
|
GetProfileLike = "get_profile_like"
|
||||||
}
|
}
|
||||||
|
@@ -1 +1 @@
|
|||||||
export const version = '1.6.6';
|
export const version = '1.6.7';
|
||||||
|
@@ -29,7 +29,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('V1.6.6', 'napcat-update-button', 'secondary')
|
SettingButton('V1.6.7', 'napcat-update-button', 'secondary')
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
SettingList([
|
SettingList([
|
||||||
|
@@ -167,7 +167,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("V1.6.6", "napcat-update-button", "secondary")
|
SettingButton("V1.6.7", "napcat-update-button", "secondary")
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
SettingList([
|
SettingList([
|
||||||
|
Reference in New Issue
Block a user