我目前正在尝试创建一个阻止用户并发送好友请求命令。但是,我碰壁了。该漫游器似乎没有对我的帐户的许可或授权,因此它无法发送朋友请求或阻止用户。我如何赋予它权限?还是根本不可能?请让我知道,我真的很感激:>
我当前的命令代码如下:
@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}")
答案 0 :(得分:0)
不幸的是,Discord不允许漫游器用户添加,阻止或删除朋友。您只能通过普通的Discord用户执行这些操作,如果您要通过程序执行此操作,那将是自举,这违反Discord的服务条款。
在此处了解有关send_friend_request()方法的信息
Discord关于自我攻击的立场:
https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-