Skip to content

Commit 269bc52

Browse files
author
Stanislav Lukyanov
committed
add animation type for inputMediaFiles
1 parent 36756d9 commit 269bc52

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

configs.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3265,6 +3265,14 @@ func prepareInputMediaParam(inputMedia interface{}, idx int) interface{} {
32653265
}
32663266

32673267
return m
3268+
case InputMediaAnimation:
3269+
if m.Media.NeedsUpload() {
3270+
m.Media = fileAttach(fmt.Sprintf("attach://file-%d", idx))
3271+
}
3272+
3273+
if m.Thumb != nil && m.Thumb.NeedsUpload() {
3274+
m.Thumb = fileAttach(fmt.Sprintf("attach://file-%d-thumb", idx))
3275+
}
32683276
case InputMediaDocument:
32693277
if m.Media.NeedsUpload() {
32703278
m.Media = fileAttach(fmt.Sprintf("attach://file-%d", idx))
@@ -3307,6 +3315,20 @@ func prepareInputMediaFile(inputMedia interface{}, idx int) []RequestFile {
33073315
})
33083316
}
33093317

3318+
if m.Thumb != nil && m.Thumb.NeedsUpload() {
3319+
files = append(files, RequestFile{
3320+
Name: fmt.Sprintf("file-%d", idx),
3321+
Data: m.Thumb,
3322+
})
3323+
}
3324+
case InputMediaAnimation:
3325+
if m.Media.NeedsUpload() {
3326+
files = append(files, RequestFile{
3327+
Name: fmt.Sprintf("file-%d", idx),
3328+
Data: m.Media,
3329+
})
3330+
}
3331+
33103332
if m.Thumb != nil && m.Thumb.NeedsUpload() {
33113333
files = append(files, RequestFile{
33123334
Name: fmt.Sprintf("file-%d", idx),

0 commit comments

Comments
 (0)