mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: some png can not send
This commit is contained in:
parent
33688e9e5c
commit
23be081d29
@ -63,7 +63,7 @@ export class SendMsgElementConstructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async pic(picPath: string, summary: string = "", subType: 0|1=0): Promise<SendPicElement> {
|
static async pic(picPath: string, summary: string = "", subType: 0|1=0): Promise<SendPicElement> {
|
||||||
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) {
|
if (fileSize === 0) {
|
||||||
throw "文件异常,大小为0";
|
throw "文件异常,大小为0";
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ export class SendMsgElementConstructor {
|
|||||||
fileSize: fileSize.toString(),
|
fileSize: fileSize.toString(),
|
||||||
picWidth: imageSize.width,
|
picWidth: imageSize.width,
|
||||||
picHeight: imageSize.height,
|
picHeight: imageSize.height,
|
||||||
fileName: md5 + ext,
|
fileName: fileName,
|
||||||
sourcePath: path,
|
sourcePath: path,
|
||||||
original: true,
|
original: true,
|
||||||
picType: isGIF(picPath) ? PicType.gif : PicType.jpg,
|
picType: isGIF(picPath) ? PicType.gif : PicType.jpg,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user