无法找到嵌入的用户头像(discord python)

问题描述 投票:0回答:1

我有这个代码,我在其中跟踪播放时间(不,它还没有完成) 但在设置时我遇到了这个问题:

discord.ext.commands.errors.CommandInvokeError:命令引发异常:AttributeError:“成员”对象没有属性“user_avatar_url”

这是我的代码: 感谢您的阅读和帮助:D

#embeds
@client.command()
async def embed(ctx):
    print("embed send") #me trying to debug this
    embed = discord.Embed(title="Test", url="https://google.com", description="I am an idiot", color=0xEB0E0E)
    embed.set_author(name=ctx.author.display_name, url="https://google.com", icon_url=ctx.author.user_avatar_url)
    await ctx.send(embed=embed)
python discord bots embed
1个回答
0
投票

ctx.author.user_avatar_url
替换为
ctx.author.avatar_url
,它应该按预期工作。

© www.soinside.com 2019 - 2024. All rights reserved.