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 或类似的东西加入服务器?
基础教程推荐
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
