mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 20:31:36 +00:00
fix(telegram): improve gif handling
This commit is contained in:
@@ -107,6 +107,17 @@ export function extensionForMime(mime?: string | null): string | undefined {
|
||||
return EXT_BY_MIME[mime.toLowerCase()];
|
||||
}
|
||||
|
||||
export function isGifMedia(opts: {
|
||||
contentType?: string | null;
|
||||
fileName?: string | null;
|
||||
}): boolean {
|
||||
if (opts.contentType?.toLowerCase() === "image/gif") return true;
|
||||
const ext = opts.fileName
|
||||
? path.extname(opts.fileName).toLowerCase()
|
||||
: undefined;
|
||||
return ext === ".gif";
|
||||
}
|
||||
|
||||
export function imageMimeFromFormat(
|
||||
format?: string | null,
|
||||
): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user