diff --git a/main.go b/main.go index 6e5f544..9078c96 100644 --- a/main.go +++ b/main.go @@ -79,11 +79,21 @@ func main() { if c == 50 { break } - result := &tgbotapi.InlineQueryResultPhoto{ - Type: "photo", - ID: uuid.New().String(), - URL: image.Image, - ThumbURL: image.Thumbnail, + var result interface{} + if strings.HasSuffix(image.Image, ".gif") { + result = &tgbotapi.InlineQueryResultGIF{ + Type: "gif", + 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) }