mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-11 23:40:24 +00:00
feat: #162
This commit is contained in:
20
src/onebot11/action/extends/FetchCustomFace.ts
Normal file
20
src/onebot11/action/extends/FetchCustomFace.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { NTQQMsgApi } from '@/core/apis';
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
count: { type: 'number' },
|
||||
}
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class FetchCustomFace extends BaseAction<Payload, any> {
|
||||
actionName = ActionName.FetchCustomFace;
|
||||
PayloadSchema = SchemaData;
|
||||
protected async _handle(payload: Payload) {
|
||||
return await NTQQMsgApi.fetchFavEmojiList(payload.count || 48);
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,7 @@ import SetEssenceMsg from './group/SetEssenceMsg';
|
||||
import GetRecentContact from './user/GetRecentContact';
|
||||
import { GetProfileLike } from './extends/GetProfileLike';
|
||||
import SetGroupHeader from './extends/SetGroupHeader';
|
||||
import { FetchCustomFace } from './extends/FetchCustomFace';
|
||||
|
||||
export const actionHandlers = [
|
||||
new RebootNormal(),
|
||||
@@ -156,7 +157,8 @@ export const actionHandlers = [
|
||||
new GetRecentContact(),
|
||||
new MarkAllMsgAsRead(),
|
||||
new GetProfileLike(),
|
||||
new SetGroupHeader()
|
||||
new SetGroupHeader(),
|
||||
new FetchCustomFace()
|
||||
];
|
||||
|
||||
function initActionMap() {
|
||||
|
||||
@@ -99,5 +99,6 @@ export enum ActionName {
|
||||
GetRecentContact = 'get_recent_contact',
|
||||
_MarkAllMsgAsRead = '_mark_all_as_read',
|
||||
GetProfileLike = 'get_profile_like',
|
||||
SetGroupHeader = "set_group_head"
|
||||
SetGroupHeader = "set_group_head",
|
||||
FetchCustomFace = "fetch_custom_face"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user