問題描述
注意:我使用的是 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 或類似的東西加入服務器?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!