fix: PicSubType

This commit is contained in:
手瓜一十雪 2024-11-21 13:10:49 +08:00
parent 2bf8d8f791
commit eeef5409dc
2 changed files with 11 additions and 5 deletions

View File

@ -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<SendPicElement> {
async createValidSendPicElement(context: MessageContext, picPath: string, summary: string = '', subType: PicSubType = 0): Promise<SendPicElement> {
const { md5, fileName, path, fileSize } = await this.core.apis.FileApi.uploadFile(picPath, ElementType.PIC, subType);
if (fileSize === 0) {
throw new Error('文件异常大小为0');

View File

@ -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
}
/**
* @类型枚举