Add support for GIFs

main
Astra 2022-10-16 14:23:42 +00:00
parent cf1dd4d760
commit 869938b061
1 changed files with 15 additions and 5 deletions

20
main.go
View File

@ -79,11 +79,21 @@ func main() {
if c == 50 { if c == 50 {
break break
} }
result := &tgbotapi.InlineQueryResultPhoto{ var result interface{}
Type: "photo", if strings.HasSuffix(image.Image, ".gif") {
ID: uuid.New().String(), result = &tgbotapi.InlineQueryResultGIF{
URL: image.Image, Type: "gif",
ThumbURL: image.Thumbnail, ID: uuid.New().String(),
URL: image.Image,
ThumbURL: image.Thumbnail,
}
} else {
result = &tgbotapi.InlineQueryResultPhoto{
Type: "photo",
ID: uuid.New().String(),
URL: image.Image,
ThumbURL: image.Thumbnail,
}
} }
results = append(results, result) results = append(results, result)
} }