(msg: Api.Message)
| 259 | return 0; |
| 260 | } |
| 261 | |
| 262 | private getVideoDuration(msg: Api.Message): number { |
| 263 | if (!msg.video) return 0; |
| 264 | |
| 265 | const videoAttr = msg.video.attributes?.find( |
| 266 | (attr: any) => attr.className === "DocumentAttributeVideo" |
| 267 | ); |
| 268 | return (videoAttr as any)?.duration || 0; |
| 269 | } |
| 270 | |
| 271 | private async convertWithFFmpeg(inputFile: string, outputFile: string): Promise<void> { |