diff --git a/src/core/packet/message/element.ts b/src/core/packet/message/element.ts index dd66ea37..43a0a767 100644 --- a/src/core/packet/message/element.ts +++ b/src/core/packet/message/element.ts @@ -14,6 +14,7 @@ import { GroupFileExtra } from "@/core/packet/transformer/proto"; import { + BaseEmojiType, NTMsgAtType, PicType, SendArkElement, @@ -162,7 +163,7 @@ export class PacketMsgFaceElement extends IPacketMsgElement { constructor(element: SendFaceElement) { super(element); this.faceId = element.faceElement.faceIndex; - this.isLargeFace = element.faceElement.faceType === 3; + this.isLargeFace = element.faceElement.faceType === BaseEmojiType.CHAIN_SUPER_EMOJI; } buildElement(): NapProtoEncodeStructType[] { diff --git a/src/core/services/NodeIKernelBaseEmojiService.ts b/src/core/services/NodeIKernelBaseEmojiService.ts new file mode 100644 index 00000000..45ce4255 --- /dev/null +++ b/src/core/services/NodeIKernelBaseEmojiService.ts @@ -0,0 +1,17 @@ +import { DownloadBaseEmojiByIdReq, DownloadBaseEmojiByUrlReq, GetBaseEmojiPathReq, PullSysEmojisReq } from '../types'; + +export interface NodeIKernelBaseEmojiService { + removeKernelBaseEmojiListener(listenerId: number): void; + + addKernelBaseEmojiListener(listener: unknown): number; + + isBaseEmojiPathExist(args: Array): unknown; + + fetchFullSysEmojis(pullSysEmojisReq: PullSysEmojisReq): unknown; + + getBaseEmojiPathByIds(getBaseEmojiPathReqs: Array): unknown; + + downloadBaseEmojiByIdWithUrl(downloadBaseEmojiByUrlReq: DownloadBaseEmojiByUrlReq): unknown; + + downloadBaseEmojiById(downloadBaseEmojiByIdReq: DownloadBaseEmojiByIdReq): unknown; +} \ No newline at end of file diff --git a/src/core/types/element.ts b/src/core/types/element.ts index 30542b92..9e8a6ab6 100644 --- a/src/core/types/element.ts +++ b/src/core/types/element.ts @@ -1,4 +1,5 @@ -import { ElementType, FaceType, MessageElement, NTGrayTipElementSubTypeV2, PicSubType, PicType, TipAioOpGrayTipElement, TipGroupElement, NTVideoType } from "./msg"; +import { BaseEmojiType } from "./emoji"; +import { ElementType, MessageElement, NTGrayTipElementSubTypeV2, PicSubType, PicType, TipAioOpGrayTipElement, TipGroupElement, NTVideoType } from "./msg"; type ElementFullBase = Omit; @@ -30,7 +31,7 @@ export interface TextElement { export interface FaceElement { faceIndex: number; - faceType: FaceType; + faceType: BaseEmojiType; faceText?: string; packId?: string; stickerId?: string; @@ -253,7 +254,7 @@ export interface FaceBubbleElement { faceFlag: number; content: string; oldVersionStr: string; - faceType: number; + faceType: BaseEmojiType; others: string; yellowFaceInfo: { index: number; diff --git a/src/core/types/emoji.ts b/src/core/types/emoji.ts new file mode 100644 index 00000000..323cea2b --- /dev/null +++ b/src/core/types/emoji.ts @@ -0,0 +1,59 @@ +export enum PullMomentType { + REINSTALL = 0, + RESTART_FIRST_AIO = 1, + LOGIN_APP = 2, + SINGEL_PULL_NOTIFY = 3, + TRIGGER_SPECIFIC_EMOJI_RANDOM_RESULT = 4 +} + +export interface PullSysEmojisReq { + fetchAdvaceSource: boolean; + fetchBaseSource: boolean; + pullMoment: PullMomentType; + pullType: number; + refresh: boolean; + thresholdValue: number; +} + +export enum BaseEmojiType { + NORMAL_EMOJI = 0, + SUPER_EMOJI = 1, + RANDOM_SUPER_EMOJI = 2, + CHAIN_SUPER_EMOJI = 3, + EMOJI_EMOJI = 4 +} + +export interface GetBaseEmojiPathReq { + emojiId: string; + type: BaseEmojiType; +} +export enum EmojiPanelCategory { + OTHER_PANEL = 0, + NORMAL_PANEL = 1, + SUPER_PANEL = 2, + RED_HEART_PANEL = 3 +} + +export interface DownloadBaseEmojiInfo { + baseResDownloadUrl: string; + advancedResDownloadUrl: string; +} + +export interface DownloadBaseEmojiByUrlReq { + emojiId: string; + groupName: string; + panelCategory: EmojiPanelCategory; + downloadInfo: DownloadBaseEmojiInfo; +} +// public final class DownloadBaseEmojiByIdReq { +// public String groupName; +// public EmojiPanelCategory panelCategory; +// public String emojiId = ""; +// public String qzoneCode = ""; + +export interface DownloadBaseEmojiByIdReq { + emojiId: string; + groupName: string; + panelCategory: EmojiPanelCategory; + qzoneCode: string; +} \ No newline at end of file diff --git a/src/core/types/index.ts b/src/core/types/index.ts index dffa91b9..95958179 100644 --- a/src/core/types/index.ts +++ b/src/core/types/index.ts @@ -8,4 +8,5 @@ export * from './webapi'; export * from './sign'; export * from './element'; export * from './constant'; -export * from './graytip'; \ No newline at end of file +export * from './graytip'; +export * from './emoji'; \ No newline at end of file diff --git a/src/core/types/msg.ts b/src/core/types/msg.ts index 4021da58..12989dbe 100644 --- a/src/core/types/msg.ts +++ b/src/core/types/msg.ts @@ -264,18 +264,6 @@ export enum NTGrayTipElementSubTypeV2 { GRAYTIP_ELEMENT_SUBTYPE_XMLMSG = 12, } -/** - * 表情类型枚举 - */ -export enum FaceType { - Unknown = 0, - OldFace = 1, // 老表情 - Normal = 2, // 常规表情 - AniSticke = 3, // 动画贴纸 - Lottie = 4,// 新格式表情 - Poke = 5 // 可变Poke -} - /** * Poke 类型枚举 */ diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index 4894e13a..8d51e8ab 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -7,7 +7,6 @@ import { CustomMusicSignPostData, ElementType, FaceIndex, - FaceType, IdMusicSignPostData, MessageElement, NapCatCore, @@ -16,6 +15,7 @@ import { RawMessage, SendMessageElement, SendTextElement, + BaseEmojiType, } from '@/core'; import faceConfig from '@/core/external/face_config.json'; import { NapCatOneBot11Adapter, OB11Message, OB11MessageData, OB11MessageDataType, OB11MessageFileBase, } from '@/onebot'; @@ -547,7 +547,7 @@ export class OneBotMsgApi { elementId: '', faceElement: { faceIndex: FaceIndex.DICE, - faceType: FaceType.AniSticke, + faceType: BaseEmojiType.CHAIN_SUPER_EMOJI, faceText: '[骰子]', packId: '1', stickerId: '33', @@ -564,7 +564,7 @@ export class OneBotMsgApi { faceElement: { faceIndex: FaceIndex.RPS, faceText: '[包剪锤]', - faceType: 3, + faceType: BaseEmojiType.CHAIN_SUPER_EMOJI, packId: '1', stickerId: '34', sourceType: 1,