我试图在用户运行命令时替换机器人的化身图像。我该怎么做?我成功地替换了昵称,但没有替换图像
await ctx.guild.me.edit(nick=nick)
^替换昵称
我试过(尼克=尼克,阿凡达=阿凡达),但没有成功
编辑:
@client.command()
async def test(ctx):
if ctx.guild.id == second_server:
await ctx.guild.me.edit(nick=nick, avatar_url=avatar)
pfp_path = "Profile-Picture.png"
with open(pfp_path, "rb") as pfp:
await client.user.edit(password=None, avatar=pfp.read())
print("profile picture changed")
根据official docs的意见,应采取以下措施:
您不能直接提供所需配置文件图片的URL
注意:仅支持JPEG和PNG格式
相关问题 更多 >
编程相关推荐