rockneurotiko/ex_gram

setChatMenuButton error

prtngn opened this issue ยท 6 comments

We have auto generated method:

  method(
    :post,
    "setChatMenuButton",
    [{chat_id, [:integer], :optional}, {menu_button, [MenuButton], :optional}],
    true,
    "Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success."
  )

But menu_button must be MenuButtonCommands, MenuButtonWebApp, MenuButtonDefault.

Oh, you are right, I'll fix it in the next days creating a wrapper struct like ChatMember

Did you forget about this error? )

I totally forgot about it ๐Ÿ˜‚

Can you check the PR #91 ? It adds the generic type MenuButton

I't worked, but there is one problem.

ExGram.set_chat_menu_button(chat_id: ..., bot: :..., menu_button: %ExGram.Model.MenuButtonWebApp{type: "web_app", text: "Hello", web_app: %ExGram.Model.WebAppInfo{url: "https://example.com"}})

We need to set type: "web_app", but this model (ExGram.Model.MenuButtonWebApp), in fact, already means this type.

Yeah, that's a problem with the Enum type that I still didn't dedicated too much time to solve ๐Ÿ˜„