Skip to content

Cant send gif #564

Answered by ByakuyaKu
ByakuyaKu asked this question in Q&A
Discussion options

You must be logged in to vote

Tryed a lot of methods fro sending animations. This is correct variant for sending gif? telegram-bot-api version is v5.5.1

var musicList []tgbotapi.FileURL
var gifList []tgbotapi.FileURL

	for j := i; j < len(obj.Attachments); j++ {
		if obj.Attachments[j].Photo.MaxSize().URL != "" {
			media[j] = tgbotapi.NewInputMediaPhoto(tgbotapi.FileURL(obj.Attachments[j].Photo.MaxSize().URL))
		} else if obj.Attachments[j].Doc.Ext == "gif" || obj.Attachments[j].Doc.Ext == "gifv" {
			gifList = append(gifList, tgbotapi.FileURL(obj.Attachments[j].Doc.URL))
		} else if obj.Attachments[j].Audio.URL != "" {
			musicList = append(musicList, tgbotapi.FileURL(obj.Attachments[j].Audio.URL))
		}
	}

	post :=…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ByakuyaKu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant