Refine GIF handling and update comments

Update comments for clarity and adjust GIF handling logic.
This commit is contained in:
叁月柒
2025-12-06 15:36:40 +08:00
committed by GitHub
parent 6a159dcbfb
commit 44542bdf59

View File

@@ -422,10 +422,10 @@ async function uploadFileToTelegram(context, fullId, metadata, fileExt, fileName
? fileTypeMap[Object.keys(fileTypeMap).find(key => fileType.startsWith(key))]
: defaultType;
// GIF 发送接口特殊处理
// GIF ICO 等发送接口特殊处理
if (fileType === 'image/gif' || fileType === 'image/webp' || fileExt === 'gif' || fileExt === 'webp') {
sendFunction = { 'url': 'sendAnimation', 'type': 'animation' };
}else if (fileType === 'image/svg+xml' || fileType === 'image/x-icon') {
} else if (fileType === 'image/svg+xml' || fileType === 'image/x-icon') {
sendFunction = { 'url': 'sendDocument', 'type': 'document' };
}
@@ -554,4 +554,4 @@ async function tryRetry(err, context, uploadChannel, fullId, metadata, fileExt,
}
return createResponse(JSON.stringify(errMessages), { status: 500 });
}
}