mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 08:10:25 +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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user