Skip to content

NewMediaGroup , cannot send list video when use []tgbotapi.InputMediaVideo #428

Answered by Syfaro
radiaku asked this question in Q&A
Discussion options

You must be logged in to vote

You need to use []interface{} instead of []tgbotapi.InputMediaVideo because that's the type NewMediaGroup is expecting:

func NewMediaGroup(chatID int64, files []interface{}) MediaGroupConfig {

var listMediaVideoInput []interface{}
for _, value := range dataListMediaVideo {
	var tempVideoInput = tgbotapi.NewInputMediaVideo(value)
	listMediaVideoInput = append(listMediaVideoInput, tempVideoInput)
}
msg = tgbotapi.NewMediaGroup(update.Message.Chat.ID, listMediaVideoInput)
bot.Send(msg)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Syfaro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #427 on February 23, 2021 22:07.