【发布时间】: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
但我不知道出了什么问题或如何解决它。
【问题讨论】:
-
请勿发布screenshots of code,将minimal working example所需的相关代码直接粘贴到您的帖子中。
-
请edit您的问题包含所有相关信息作为文本。您可以
code format代码和控制台文本。考虑再看看How to Ask 和minimal reproducible example 帮助页面。 -
好的,抱歉现在正在处理它
-
如果您发现了您的问题,请将其作为答案发布,以防其他人遇到同样的问题。说“谢谢我想通了”对任何人都没有用。
标签: python-3.x discord.py