rockneurotiko/ex_gram

send_media_group/3 does not accept list of InputMediaPhoto

Closed this issue · 2 comments

While trying to send the following media group:

[
  %ExGram.Model.InputMediaPhoto{
    caption: nil,
    caption_entities: nil,
    media: "https://sbermarket.ru/spree/products/303813/original/200585.jpg",
    parse_mode: nil,
    type: "photo"
  },
  %ExGram.Model.InputMediaPhoto{
    caption: nil,
    caption_entities: nil,
    media: "https://sbermarket.ru/spree/products/303813/original/200585.jpg",
    parse_mode: nil,
    type: "photo"
  }
]

I get this error:

** (ExGram.Error) Mandatory parameter types don't match: parameter 1 expected [array: [InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]] but got [%ExGram.Model.InputMediaPhoto{caption: nil, caption_entities: nil, media: "https://sbermarket.ru/spree/products/303813/original/200585.jpg", parse_mode: nil, type: "photo"}, %ExGram.Model.InputMediaPhoto{caption: nil, caption_entities: nil, media: "https://sbermarket.ru/spree/products/303813/original/200585.jpg", parse_mode: nil, type: "photo"}]
    (ex_gram 0.21.0) lib/ex_gram/macros.ex:105: ExGram.send_media_group!/3

The input seems correct, probably error is in type checker?

Yeah, I probably messed up in the big refactor. I'll take a look, thanks for the report!!

This was fixed on #59