如何自动将用户添加到公会? [英] How to add a user to a guild automatically?

查看:52
本文介绍了如何自动将用户添加到公会?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Discord.js中的 Guild.leave()方法,但是有什么方法可以将 user 自动添加到公会中吗?我知道所谓的自助机器人"违反了Discord的服务条款,但是我已经搜索了5天,找不到任何东西...

I'm aware of the Guild.leave() method in Discord.js, but is there any way to add a user to a guild automatically? I know so-called "selfbots" are against Discord's Terms of Service, but I've been searching for 5 days now and can't find anything...

推荐答案

为了获得将Discord用户添加到服务器的权限,必须为您的客户端授予OAuth2访问令牌,该令牌具有 guilds.join 范围.单击此处,以获取有关OAuth2流程和示例的正式Discord文档.

In order to gain permission to add a Discord user to a server, your client must be granted an OAuth2 access token with the guilds.join scope. Click here for the official Discord documentation on the OAuth2 flow and examples.

在Discord.js中,可以将用户添加到服务器,但是只能按照链接文档中的说明执行OAuth2流程之后.参见 Guild#addMember() ,将用户添加到<带有访问令牌的href ="https://discord.js.org/#/docs/main/v12/class/Guild" rel ="nofollow noreferrer">公会.

In Discord.js, adding a user to a server is possible, but only after following the OAuth2 process as described in the linked documentation. See Guild#addMember() to add a User to a Guild with an access token.

这篇关于如何自动将用户添加到公会?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆