英文:
Is there a way to create a oauth2 discord link that will automatically add somebody to the server?
问题
有没有办法创建一个OAuth2 Discord链接,可以自动将某人添加到服务器中?
目前我只是使用普通的授权链接
https://discord.com/api/oauth2/authorize?
英文:
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?
答案1
得分: 1
要自动将用户添加到服务器,您需要使用已添加到服务器并具有必要权限以添加成员的机器人。因此,您需要为该机器人生成一个OAuth2链接。
当用户点击OAuth2链接并授权机器人加入他们的服务器时,您可以使用机器人使用服务器的ID和guild.addMember
API方法来以编程方式将用户添加到所需的服务器。
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论