Is there a way to create a oauth2 discord link that will automatically add somebody to the server?

Is there a way to create a oauth2 discord link that will automatically add somebody to a server ?

Right now I’m just using normal link for authorization

https://discord.com/api/oauth2/authorize?

>Solution :

To add a user to a server automatically, you’ll need to use a bot that has already been added to the server and has the necessary permissions to add members. So you would generate an OAuth2 link for the bot.

When a user clicks on the OAuth2 link and authorizes the bot to join their server, you can use the bot to programmatically add the user to the desired server using the server’s ID and the guild.addMember API method

Leave a Reply