Search code examples
javascriptnode.jsmongodboauth-2.0discord.js

Can I check with oauth2 if the user has a verified email on the discord account?


Can I check with oauth2 if the user has a verified email or telephone on the discord account?

I need this because I want to create a verification (ticket bot) Please do not reply in a way that "you have this option in the server settings".

Information: discord.js v14 javascript node.js

I tried to search on the internet (I'm Polish so it's hard to search using the translator).


Solution

  • There's an email scope for Discord's OAuth2 but not a phone number scope. Here's the documentation.

    If the user has a verified email, that will be sent to your application during the callback. If the email field isn't there, you can assume the user doesn't have a verified email.