mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-01-31 09:03:19 +08:00
Refine GIF handling and update comments
Update comments for clarity and adjust GIF handling logic.
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user