本文介绍了Discord.py user.block/user.send_friend_request:错误403/禁止我如何赋予bot允许发送好友请求和阻止用户的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm currently trying to create a block user and send friend request command. However, I've hit a wall. It seems like the bot doesn't have permission or authorization to my account so it can't send friend requests or block users. How do I give it the permissions? Or maybe it isn't possible at all? Please let me know, I'd really appreciate it :>

我当前的命令代码如下:

My current code for the commands is below:

    @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}")

推荐答案

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

Unfortunately, Discord does not allow bot users to add, block, or remove friends. You can only perform these actions through a normal Discord user, and if you were to do this through the program, that would be self botting, which is against Discord's Terms of Service.

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

Read about this send_friend_request() method here:

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

Discord对自举的立场:

Discord's stance on self botting:

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

这篇关于Discord.py user.block/user.send_friend_request:错误403/禁止我如何赋予bot允许发送好友请求和阻止用户的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 16:15