weibeu / Flask-Discord

Discord OAuth2 extension for Flask. An Easier implementation of "Log In With Discord".
https://flask-discord.readthedocs.io/en/latest/
MIT License
182 stars 47 forks source link

Implement Email scope #57

Closed FabiChan99 closed 3 years ago

FabiChan99 commented 3 years ago

Hey, i would ask if it is possible to add Support to get a users Email?

weibeu commented 3 years ago

The scopes which are used by default includes email. So you should be able to get user email after they authorize your application and auth grant is completed.

FabiChan99 commented 3 years ago

But how will i get the users email? I dont find anything in the library

weibeu commented 3 years ago

Take a look at me() function in example here: https://flask-discord.readthedocs.io/en/latest/introduction.html#basic-usage

As they used user.name, similarly you can do user.email to get users email.