@@ -331,6 +331,7 @@ async function deliverMediaReply(params: {
331331 thread ?: TelegramThreadSpec | null ;
332332 tableMode ?: MarkdownTableMode ;
333333 mediaLocalRoots ?: readonly string [ ] ;
334+ mediaMaxBytes ?: number ;
334335 chunkText : ChunkTextFn ;
335336 mediaLoader : typeof loadWebMedia ;
336337 onVoiceRecording ?: ( ) => Promise < void > | void ;
@@ -353,7 +354,10 @@ async function deliverMediaReply(params: {
353354 const isFirstMedia = first ;
354355 const media = await params . mediaLoader (
355356 mediaUrl ,
356- buildOutboundMediaLoadOptions ( { mediaLocalRoots : params . mediaLocalRoots } ) ,
357+ buildOutboundMediaLoadOptions ( {
358+ mediaLocalRoots : params . mediaLocalRoots ,
359+ maxBytes : params . mediaMaxBytes ,
360+ } ) ,
357361 ) ;
358362 const kind = kindFromMime ( media . contentType ?? undefined ) ;
359363 const isGif = isGifMedia ( {
@@ -693,6 +697,7 @@ export async function deliverReplies(params: {
693697 runtime : RuntimeEnv ;
694698 bot : Bot ;
695699 mediaLocalRoots ?: readonly string [ ] ;
700+ mediaMaxBytes ?: number ;
696701 replyToMode : ReplyToMode ;
697702 textLimit : number ;
698703 thread ?: TelegramThreadSpec | null ;
@@ -879,6 +884,7 @@ export async function deliverReplies(params: {
879884 thread : params . thread ,
880885 tableMode : params . tableMode ,
881886 mediaLocalRoots : params . mediaLocalRoots ,
887+ mediaMaxBytes : params . mediaMaxBytes ,
882888 chunkText,
883889 mediaLoader,
884890 onVoiceRecording : params . onVoiceRecording ,
0 commit comments