Discord.py-嵌入缩略图参数-如何获取命令的用户头像

时间:2018-09-11 20:28:13

标签: python-3.x embed discord.py discord.py-rewrite

这是无效的唯一代码:

embed.set_thumbnail(user.avatar_url)    

它说我修改它时给出了2个参数,可能是由于某些语法糖或某些东西。但是,在目前的状态下(我看到的视频可以正常运行),它会引发错误:

The above exception was the direct cause of the following exception: 
Traceback (most recent call last):   
    File "C:\Users\BenHa\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 898, in invoke
    await ctx.command.invoke(ctx)   File 
"C:\Users\BenHa\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 550, in invoke        
    await injected(*ctx.args, **ctx.kwargs)   File 
"C:\Users\BenHa\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 70, in wrapped
    raise CommandInvokeError(e) from e 

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: 
    HTTPException: BAD REQUEST (status code: 400): Invalid Form Body In embed.thumbnail.url: Not a well formed URL.

不确定该怎么做。

1 个答案:

答案 0 :(得分:2)

FIX:我所要做的就是添加“ url =“,将元组内部的参数声明为url,我认为这是给定的(我很傻)。