(buffer: Buffer)
| 651 | |
| 652 | const extractFirstFrame = async (buffer: Buffer): Promise<Buffer | null> => { |
| 653 | try { |
| 654 | return await sharp(buffer, { animated: true }).png().toBuffer(); |
| 655 | } catch { |
| 656 | return null; |
| 657 | } |
| 658 | }; |
| 659 | |
| 660 | const getDocumentThumb = (doc: Api.Document): Api.TypePhotoSize | undefined => { |
| 661 | const thumbs = doc.thumbs || []; |
| 662 | if (thumbs.length === 0) return undefined; |
no outgoing calls
no test coverage detected