Get User

This will require the access token.

This requires the identify scope and to get the user email you will also require the email scope.

OAuth2.getUser(access_token).then((x) => {
    console.log(x)
}).catch((x) => {
    console.log(x)
})

This is the response you should receive.

{
  "id": '...',
  "username": '...',
  "display_name": null,
  "avatar": '...',
  "avatar_decoration": null,
  "discriminator": '...',
  "public_flags": 64,
  "flags": 64,
  "banner": null,
  "banner_color": '...',
  "accent_color": ...,
  "locale": '...',
  "mfa_enabled": false,
  "premium_type": 0,
  "email": '...',
  "verified": true
}

Last updated