如何从上下文中获取发送命令的人的头像网址?
Unable to find template "home/index.html.twig" (looked into: C:\xampp\htdocs\myproject/templates).
Unable to find template "home/index.html.twig" (looked into: C:\xampp\htdocs\myproject/templates).
如您所见,我可以轻松地从上下文中找到作者,但是如何获取他们的头像?
我已经看到了解决方案,但不是从上下文中获得的
答案 0 :(得分:2)
要获取作者的头像网址,只需使用ctx.message.author.avatar_url
@client.command()
async def test(ctx):
print("Username is = " + ctx.message.author)
print(ctx.message.author + "'s avatar url is = " + ctx.message.author.avatar_url)