mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-16 21:30:32 +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) {
|
static async getSingleMsg(peer: Peer, seq: string) {
|
||||||
return await napCatCore.session.getMsgService().getSingleMsg(peer, seq);
|
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) {
|
static async queryMsgsWithFilterExWithSeq(peer: Peer, msgSeq: string, msgTime: string, senderUid: string) {
|
||||||
let ret = await napCatCore.session.getMsgService().queryMsgsWithFilterEx('0', msgTime, msgSeq, {
|
let ret = await napCatCore.session.getMsgService().queryMsgsWithFilterEx('0', msgTime, msgSeq, {
|
||||||
chatInfo: peer,
|
chatInfo: peer,
|
||||||
|
|||||||
@ -393,8 +393,13 @@ export interface NodeIKernelMsgService {
|
|||||||
translatePtt2Text(MsgId: string, Peer: {}, MsgElement: {}): unknown;
|
translatePtt2Text(MsgId: string, Peer: {}, MsgElement: {}): unknown;
|
||||||
|
|
||||||
setPttPlayedState(...args: unknown[]): unknown;
|
setPttPlayedState(...args: unknown[]): unknown;
|
||||||
|
// NodeIQQNTWrapperSession fetchFavEmojiList [
|
||||||
fetchFavEmojiList(...args: unknown[]): unknown;
|
// "",
|
||||||
|
// 48,
|
||||||
|
// true,
|
||||||
|
// true
|
||||||
|
// ]
|
||||||
|
fetchFavEmojiList(str: string, num: number, uk1: boolean, uk2: boolean): Promise<unknown>;
|
||||||
|
|
||||||
addFavEmoji(...args: unknown[]): unknown;
|
addFavEmoji(...args: unknown[]): unknown;
|
||||||
|
|
||||||
|
|||||||
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 GetRecentContact from './user/GetRecentContact';
|
||||||
import { GetProfileLike } from './extends/GetProfileLike';
|
import { GetProfileLike } from './extends/GetProfileLike';
|
||||||
import SetGroupHeader from './extends/SetGroupHeader';
|
import SetGroupHeader from './extends/SetGroupHeader';
|
||||||
|
import { FetchCustomFace } from './extends/FetchCustomFace';
|
||||||
|
|
||||||
export const actionHandlers = [
|
export const actionHandlers = [
|
||||||
new RebootNormal(),
|
new RebootNormal(),
|
||||||
@ -156,7 +157,8 @@ export const actionHandlers = [
|
|||||||
new GetRecentContact(),
|
new GetRecentContact(),
|
||||||
new MarkAllMsgAsRead(),
|
new MarkAllMsgAsRead(),
|
||||||
new GetProfileLike(),
|
new GetProfileLike(),
|
||||||
new SetGroupHeader()
|
new SetGroupHeader(),
|
||||||
|
new FetchCustomFace()
|
||||||
];
|
];
|
||||||
|
|
||||||
function initActionMap() {
|
function initActionMap() {
|
||||||
|
|||||||
@ -99,5 +99,6 @@ export enum ActionName {
|
|||||||
GetRecentContact = 'get_recent_contact',
|
GetRecentContact = 'get_recent_contact',
|
||||||
_MarkAllMsgAsRead = '_mark_all_as_read',
|
_MarkAllMsgAsRead = '_mark_all_as_read',
|
||||||
GetProfileLike = 'get_profile_like',
|
GetProfileLike = 'get_profile_like',
|
||||||
SetGroupHeader = "set_group_head"
|
SetGroupHeader = "set_group_head",
|
||||||
|
FetchCustomFace = "fetch_custom_face"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user