Is there any way to have a discord bot join a server with accept_invite or anything like that?

风格不统一 提交于 2019-12-25 01:53:06

问题


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)

I've already tried

@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

Also, running the accept_invite gives the following:

discord.errors.Forbidden: FORBIDDEN (status code: 403): Bots cannot use this endpoint


回答1:


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.

You can generate an invite link here



来源:https://stackoverflow.com/questions/55554578/is-there-any-way-to-have-a-discord-bot-join-a-server-with-accept-invite-or-anyth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!