问题
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