Skip to content

Commit 41a575d

Browse files
committed
feat: enhance cloneInputMedia function to support PaidMediaConfig with detailed media handling
1 parent 44353ae commit 41a575d

File tree

2 files changed

+484
-39
lines changed

2 files changed

+484
-39
lines changed

configs.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3339,6 +3339,30 @@ func cloneInputMedia(media InputMedia) InputMedia {
33393339
clone.Media = cloneInputMedia(m.Media)
33403340
}
33413341
return clone
3342+
case *PaidMediaConfig:
3343+
clone := &PaidMediaConfig{
3344+
BaseChat: m.BaseChat,
3345+
StarCount: m.StarCount,
3346+
Payload: m.Payload,
3347+
Caption: m.Caption,
3348+
ParseMode: m.ParseMode,
3349+
CaptionEntities: m.CaptionEntities,
3350+
ShowCaptionAboveMedia: m.ShowCaptionAboveMedia,
3351+
}
3352+
if m.Media != nil {
3353+
clone.Media = &InputPaidMedia{
3354+
Type: m.Media.Type,
3355+
Thumb: m.Media.Thumb,
3356+
Width: m.Media.Width,
3357+
Height: m.Media.Height,
3358+
Duration: m.Media.Duration,
3359+
SupportsStreaming: m.Media.SupportsStreaming,
3360+
}
3361+
if m.Media.Media != nil {
3362+
clone.Media.Media = cloneInputMedia(m.Media.Media)
3363+
}
3364+
}
3365+
return clone
33423366
}
33433367
return nil
33443368
}

0 commit comments

Comments
 (0)