From 23be081d29b35ee03c8c35d40a82a791d8c3843e Mon Sep 17 00:00:00 2001 From: linyuchen Date: Sat, 30 Mar 2024 12:02:20 +0800 Subject: [PATCH] fix: some png can not send --- src/ntqqapi/constructor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ntqqapi/constructor.ts b/src/ntqqapi/constructor.ts index 8c19c43..76e3368 100644 --- a/src/ntqqapi/constructor.ts +++ b/src/ntqqapi/constructor.ts @@ -63,7 +63,7 @@ export class SendMsgElementConstructor { } static async pic(picPath: string, summary: string = "", subType: 0|1=0): Promise { - const {md5, fileName, path, fileSize, ext} = await NTQQFileApi.uploadFile(picPath, ElementType.PIC, subType); + const {md5, fileName, path, fileSize} = await NTQQFileApi.uploadFile(picPath, ElementType.PIC, subType); if (fileSize === 0) { throw "文件异常,大小为0"; } @@ -73,7 +73,7 @@ export class SendMsgElementConstructor { fileSize: fileSize.toString(), picWidth: imageSize.width, picHeight: imageSize.height, - fileName: md5 + ext, + fileName: fileName, sourcePath: path, original: true, picType: isGIF(picPath) ? PicType.gif : PicType.jpg,