Discord.py user.block / user.send_friend_request:错误403 /禁止我如何授予bot允许发送好友请求和阻止用户的权限?

时间:2020-08-05 03:16:25

标签: python python-3.x discord discord.py discord.py-rewrite

我目前正在尝试创建一个阻止用户并发送好友请求命令。但是,我碰壁了。该漫游器似乎没有对我的帐户的许可或授权,因此它无法发送朋友请求或阻止用户。我如何赋予它权限?还是根本不可能?请让我知道,我真的很感激:>

我当前的命令代码如下:

    @client.command()
    async def unfriend(ctx, *, user: discord.User):
        await user.remove_friend()
        await ctx.send('Friend has been removed')
    
    @client.command()
    async def sendrequest(ctx, *, user: discord.User):
        await user.send_friend_request()
        await ctx.author.send('Request sent')
@client.command()
async def block(ctx, *, user: discord.User):
    await user.block()
    await ctx.send(f'{member.mention} has been blocked by {ctx.author}')

@client.command()
async def unblock(ctx, *, user: discord.User):
    await user.unblock()
    await ctx.send(f"{member.mention} has been unblocked by {ctx.author}")

1 个答案:

答案 0 :(得分:0)

不幸的是,Discord不允许漫游器用户添加,阻止或删除朋友。您只能通过普通的Discord用户执行这些操作,如果您要通过程序执行此操作,那将是自举,这违反Discord的服务条款。

在此处了解有关send_friend_request()方法的信息

https://discordpy.readthedocs.io/en/latest/api.html?highlight=add%20friend#discord.User.send_friend_request

Discord关于自我攻击的立场:

https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-