fix: gif not work

This commit is contained in:
linyuchen 2024-03-04 21:52:52 +08:00
parent 4a09a51722
commit 15fe2837dc
2 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import {
AtType,
ElementType,
ElementType, PicType,
SendFaceElement,
SendFileElement,
SendPicElement,
@ -9,7 +9,7 @@ import {
SendTextElement
} from "./types";
import {NTQQApi} from "./ntcall";
import {encodeSilk} from "../common/utils";
import {encodeSilk, isGIF} from "../common/utils";
import * as fs from "node:fs";
@ -66,7 +66,7 @@ export class SendMsgElementConstructor {
fileName: fileName,
sourcePath: path,
original: true,
picType: 1001,
picType: isGIF(picPath) ? PicType.gif : PicType.jpg,
picSubType: 0,
fileUuid: "",
fileSubId: "",

View File

@ -107,6 +107,10 @@ export interface SendPttElement {
}
}
export enum PicType {
gif = 2000,
jpg = 1000
}
export interface SendPicElement {
elementType: ElementType.PIC,
elementId: "",
@ -118,7 +122,7 @@ export interface SendPicElement {
fileName: string,
sourcePath: string,
original: boolean,
picType: number,
picType: PicType,
picSubType: number,
fileUuid: string,
fileSubId: string,