rockneurotiko / ex_gram

Telegram Bot API low level API and framework
182 stars 26 forks source link

Use subtype selector #118

Closed rockneurotiko closed 1 year ago

rockneurotiko commented 1 year ago

Fixes #117

Adds subtypes protocol in order to choose which subtype module to use when decoding the results.

rockneurotiko commented 1 year ago

The call to get_chat_member now returns:

{:ok,
 %ExGram.Model.ChatMemberOwner{
   custom_title: nil,
   is_anonymous: false,
   status: "creator",
   user: %{
     first_name: "Rock",
     id: ...,
     is_bot: false,
     language_code: "en",
     last_name: ...,
     username: ...
   }
 }}