Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with send_media_group #119

Closed
prtngn opened this issue May 11, 2023 · 4 comments
Closed

Problem with send_media_group #119

prtngn opened this issue May 11, 2023 · 4 comments

Comments

@prtngn
Copy link
Contributor

prtngn commented May 11, 2023

I'll try to send media_group with photos or documents and get same error:

      ExGram.send_media_group(
        user.telegram_id,
        media: [
          %ExGram.Model.InputMediaDocument{
            type: "document",
            media: "BQACAgIAAxkBAAEGtFRkU7LYwc22u650vKUZ9hzUAAEl13QAAnAuAAKvw6FKVOYAAbzuWHewLwQ"
          },
          %ExGram.Model.InputMediaDocument{
            type: "document",
            media: "BQACAgIAAxkBAAEBQJpkJtrMNEdgDH1ebZGm4Gpd8GB1EgACbycAAsVbOUlzhwdVzy5QHS8E"
          }
        ],
        bot: Bot.bot()
      )
** (FunctionClauseError) no function clause matching in ExGram.Macros.Checker.check_type/2
    (ex_gram 0.34.0) lib/ex_gram/macros/checker.ex:42: ExGram.Macros.Checker.check_type(InputMediaAudio, {:media, [%ExGram.Model.InputMediaDocument{type: "document", media: "BQACAgIAAxkBAAEGtFRkU7LYwc22u650vKUZ9hzUAAEl13QAAnAuAAKvw6FKVOYAAbzuWHewLwQ", thumbnail: nil, caption: nil, parse_mode: nil, caption_entities: nil, disable_content_type_detection: nil}, %ExGram.Model.InputMediaDocument{type: "document", media: "BQACAgIAAxkBAAEBQJpkJtrMNEdgDH1ebZGm4Gpd8GB1EgACbycAAsVbOUlzhwdVzy5QHS8E", thumbnail: nil, caption: nil, parse_mode: nil, caption_entities: nil, disable_content_type_detection: nil}]})
@rockneurotiko
Copy link
Owner

Can you try with master ?

Replace in mix.exs:
{:ex_gram, github: "rockneurotiko/ex_gram"}

@prtngn
Copy link
Contributor Author

prtngn commented May 11, 2023

I'm already on master branch )

@rockneurotiko
Copy link
Owner

Ahhh got it, the media parameter is a mandatory parameter, so you don't call it as a keyword, try this:

 ExGram.send_media_group(
        user.telegram_id,
        [
          %ExGram.Model.InputMediaDocument{
            type: "document",
            media: "BQACAgIAAxkBAAEGtFRkU7LYwc22u650vKUZ9hzUAAEl13QAAnAuAAKvw6FKVOYAAbzuWHewLwQ"
          },
          %ExGram.Model.InputMediaDocument{
            type: "document",
            media: "BQACAgIAAxkBAAEBQJpkJtrMNEdgDH1ebZGm4Gpd8GB1EgACbycAAsVbOUlzhwdVzy5QHS8E"
          }
        ],
        bot: Bot.bot()
      )

@prtngn
Copy link
Contributor Author

prtngn commented May 11, 2023

Yep. It's working ) Thanks.

@prtngn prtngn closed this as completed May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants