mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 04:45:46 +00:00
feat: #162
This commit is contained in:
parent
92fe654850
commit
e169199107
@ -99,6 +99,9 @@ export class NTQQMsgApi {
|
||||
static async getSingleMsg(peer: Peer, seq: string) {
|
||||
return await napCatCore.session.getMsgService().getSingleMsg(peer, seq);
|
||||
}
|
||||
static async fetchFavEmojiList(num:number) {
|
||||
return napCatCore.session.getMsgService().fetchFavEmojiList("",num , true, true)
|
||||
}
|
||||
static async queryMsgsWithFilterExWithSeq(peer: Peer, msgSeq: string, msgTime: string, senderUid: string) {
|
||||
let ret = await napCatCore.session.getMsgService().queryMsgsWithFilterEx('0', msgTime, msgSeq, {
|
||||
chatInfo: peer,
|
||||
|
@ -393,8 +393,13 @@ export interface NodeIKernelMsgService {
|
||||
translatePtt2Text(MsgId: string, Peer: {}, MsgElement: {}): unknown;
|
||||
|
||||
setPttPlayedState(...args: unknown[]): unknown;
|
||||
|
||||
fetchFavEmojiList(...args: unknown[]): unknown;
|
||||
// NodeIQQNTWrapperSession fetchFavEmojiList [
|
||||
// "",
|
||||
// 48,
|
||||
// true,
|
||||
// true
|
||||
// ]
|
||||
fetchFavEmojiList(str: string, num: number, uk1: boolean, uk2: boolean): Promise<unknown>;
|
||||
|
||||
addFavEmoji(...args: unknown[]): unknown;
|
||||
|
||||
@ -663,7 +668,7 @@ export interface NodeIKernelMsgService {
|
||||
dataMigrationGetMsgList(...args: unknown[]): unknown;
|
||||
|
||||
dataMigrationStopOperation(...args: unknown[]): unknown;
|
||||
|
||||
|
||||
//新的希望
|
||||
dataMigrationImportMsgPbRecord(DataMigrationMsgInfo: Array<{
|
||||
extensionData: string//"Hex"
|
||||
|
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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user