【问题标题】:Description wont show, and the thumbnail wont either描述不会显示,缩略图也不会显示
【发布时间】:2021-09-02 16:11:25
【问题描述】:

这是我的代码:

@client.event
async def on_command_error(ctx, error):
  if isinstance(error, commands.MissingRequiredArgument):
    emb = discord.Embed(color=0xda70d6,title = 'Issue with command', discription = 'Using the correct commands is helpful, if you dont know them use "_help"')
    emb.set_author(name = 'Alert', icon_url='https://i.pinimg.com/474x/60/5e/ac/605eac3124c4885e067002cdd4ff684a.jpg')
    emb.set_thumbnail('https://library.kissclipart.com/20191119/ww/kissclipart-help-icon-help-and-support-icon-92018307fcf5c4fa.png')
    emb.set_footer('If you have any questions just DM the onwer Saly_Derek#0031 or Co-Owner Salty_Troye#0540')
    await ctx.send(embed=emb)

当我在控制台中使用该命令时,出现此错误:

Ignoring exception in on_command_error
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 58, in on_command_error
   emb.set_thumbnail('https://library.kissclipart.com/20191119/ww/kissclipart-help-icon-help-and-support-icon-92018307fcf5c4fa.png')
TypeError: set_thumbnail() takes 1 positional argument but 2 were given

但我不知道出了什么问题或如何解决它。

【问题讨论】:

标签: python-3.x discord.py


【解决方案1】:

解决了我的问题,这 100% 有效。我的问题是 emb.set_thumbnail 我从来没有“url = 'link'”

@client.event 
async def on_command_error(ctx, error):
  if isinstance(error, commands.MissingRequiredArgument):
    emb = discord.Embed(color=0xda70d6,title = 'Issue with command', description = f'''using commands properly is helpful. Use command "_help"''') 
    emb.set_author(name = 'Alert', icon_url = 'https://i.pinimg.com/474x/60/5e/ac/605eac3124c4885e067002cdd4ff684a.jpg')
    emb.set_thumbnail(url =  'https://library.kissclipart.com/20191119/ww/kissclipart-help-icon-help-and-support-icon-92018307fcf5c4fa.png')
    emb.set_footer(text = f'If you have any questions just DM the onwer Saly_Derek#0031 or Co-Owner Salty_Troye#0540')
    await ctx.send(embed=emb)```

【讨论】:

    猜你喜欢
    • 2011-05-07
    • 2011-02-26
    • 2016-03-15
    • 1970-01-01
    • 2019-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-17
    相关资源
    最近更新 更多