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

huangapple go评论72阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年7月20日 18:11:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76728827.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定