有什么方法可以让不和谐的机器人通过 accept_invite 或类似的东西加入服务器?

Is there any way to have a discord bot join a server with accept_invite or anything like that?(有什么方法可以让不和谐的机器人通过 accept_invite 或类似的东西加入服务器?)
本文介绍了有什么方法可以让不和谐的机器人通过 accept_invite 或类似的东西加入服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

注意:我使用的是 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 或类似的东西加入服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)