From eeef5409dcffbfdfba7a01cca47993de6f087282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Thu, 21 Nov 2024 13:10:49 +0800 Subject: [PATCH] fix: PicSubType --- src/core/apis/file.ts | 3 ++- src/core/entities/msg.ts | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/core/apis/file.ts b/src/core/apis/file.ts index 6b5893c4..fbcf9d08 100644 --- a/src/core/apis/file.ts +++ b/src/core/apis/file.ts @@ -5,6 +5,7 @@ import { IMAGE_HTTP_HOST_NT, Peer, PicElement, + PicSubType, PicType, RawMessage, SendFileElement, @@ -111,7 +112,7 @@ export class NTQQFileApi { }; } - async createValidSendPicElement(context: MessageContext, picPath: string, summary: string = '', subType: 0 | 1 = 0): Promise { + async createValidSendPicElement(context: MessageContext, picPath: string, summary: string = '', subType: PicSubType = 0): Promise { const { md5, fileName, path, fileSize } = await this.core.apis.FileApi.uploadFile(picPath, ElementType.PIC, subType); if (fileSize === 0) { throw new Error('文件异常,大小为0'); diff --git a/src/core/entities/msg.ts b/src/core/entities/msg.ts index 762256a4..2999e1ca 100644 --- a/src/core/entities/msg.ts +++ b/src/core/entities/msg.ts @@ -104,7 +104,7 @@ export enum NTMsgType { * 图片类型枚举 */ export enum PicType { - NEWPIC_APNG = 2001, + NEWPIC_APNG = 2001, NEWPIC_BMP = 1005, NEWPIC_GIF = 2000, NEWPIC_JPEG = 1000, @@ -117,9 +117,14 @@ export enum PicType { * 图片子类型枚举 */ export enum PicSubType { - Normal = 0, // 普通图片 - Face = 1 // 表情包小图 - //...待补全 其余见NT Android + KNORMAL = 0, + KCUSTOM = 1, + KHOT = 2, + KDIPPERCHART = 3, + KSMART = 4, + KSPACE = 5, + KUNKNOW = 6, + KRELATED = 7 } /** * 消息@类型枚举