mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
release: 1.6.7
This commit is contained in:
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 SetEssenceMsg from './group/SetEssenceMsg';
|
||||
import GetRecentContact from './user/GetRecentContact';
|
||||
import { GetProfileLike } from './extends/GetProfileLike';
|
||||
|
||||
export const actionHandlers = [
|
||||
new RebootNormal(),
|
||||
@@ -154,7 +155,8 @@ export const actionHandlers = [
|
||||
new DelEssenceMsg(),
|
||||
new SetEssenceMsg(),
|
||||
new GetRecentContact(),
|
||||
new MarkAllMsgAsRead()
|
||||
new MarkAllMsgAsRead(),
|
||||
new GetProfileLike()
|
||||
];
|
||||
|
||||
function initActionMap() {
|
||||
|
||||
@@ -97,5 +97,6 @@ export enum ActionName {
|
||||
SetEssenceMsg = "set_essence_msg",
|
||||
DelEssenceMsg = "delete_essence_msg",
|
||||
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';
|
||||
|
||||
Reference in New Issue
Block a user