Is there any way to have a discord bot join a server with accept_invite or anything like that?(有什么方法可以让不和谐的机器人通过 accept_invite 或类似的东西加入服务器?)
问题描述
注意:我使用的是 discord.py 0.16.12
Note: I'm using discord.py 0.16.12
我想知道是否有任何方法可以让机器人在代码中加入服务器.就像有一个命令是这样的:
I am wondering if there's any way to have a bot join a server within the code. Like there's a command that would be like:
@client.command(pass_context=True)
async def join(ctx, invite):
client.join(invite)
我已经试过了
@client.command()
async def joinserver(mahlink):
await client.accept_invite(mahlink)
它不起作用.这是我在谷歌上唯一能找到的关于这个
It dosen't work. This is the only thing I could find on google about this
另外,运行 accept_invite
会得到以下结果:
Also, running the accept_invite
gives the following:
discord.errors.Forbidden: FORBIDDEN (status code: 403): Bots cannot use this endpoint
discord.errors.Forbidden: FORBIDDEN (status code: 403): Bots cannot use this endpoint
推荐答案
除了手动邀请之外,机器人不能接受邀请或加入服务器/公会.具有管理服务器权限的用户必须授权机器人,并且在加入时将授予该机器人的权限.
Bots cannot accept invites or join servers/guilds any other way than being manually invited. A user with manager server permissions must authorize the bot and the permissions said bot will be granted upon joining.
您可以在这里
这篇关于有什么方法可以让不和谐的机器人通过 accept_invite 或类似的东西加入服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有什么方法可以让不和谐的机器人通过 accept_invite 或类似的东西加入服务器?


基础教程推荐
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 筛选NumPy数组 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01