parroty / extwitter

Twitter client library for elixir.
MIT License
409 stars 129 forks source link

Email field missing from ExTwitter.Model.User #125

Open JosephHalter opened 4 years ago

JosephHalter commented 4 years ago

Updating extwitter from 0.9.6 to 0.12.0, I found out that ExTwitter.Model.User no longer has an email field, I'm already calling ExTwitter.verify_credentials(include_email: true) so the user email field is returned but ExTwitter.Model.User doesn't has an email field so I don't know how to fetch it.

I was surprised to discover no information about that issue in the changelogs for extwitter 0.10.0 and no indication on how to get around it. What's the recommended workaround apart from staying on extwitter 0.9.6?

avergin commented 2 years ago

You can get it from the raw_data attribute, which dumps all the json response from the Twitter API.

user = ExTwitter.verify_credentials(include_email: true)
user.raw_data.email

will return the email.