discord.py重写中出错:discord.ext.com.mands.errors.MissingRequired



我一直有这个错误:discord.ext.com.mands.errors.MissingRequiredArgument:question是一个缺少的必需参数。我没有发现我的代码有任何问题,我正在使用重写,请看一看:

@client.command(aliases =['insultme', 'plzinsult'])
async def _insultme(ctx, *, question):
responses = ['You make it impossible to underestimate you',
'I may love to shop but i, myself, will never buy your bullshit.',]
embed = discord.Embed(title='Question:', description=question, color=0x2332e4, inline=False)
embed.add_field(name='Answer:', value=random.choice(responses), inline=False)
await ctx.send(embed=embed)

我已经完成了完全相同的代码,只是不同的响应、别名和异步定义,它运行得很好,请帮助我不知道出了什么问题。

这里的代码图片是图像

我也遇到过同样的错误,所以我知道如何修复它!

这就是您的代码应该是

@bot.command(aliases=['insultme', 'plzinsult'])
async def insultme(ctx, *, question):
responses = ['You make it impossible to underestimate you', 'I may love to shop but i,myself, will never buy your bullshit.',]
embed = discord.Embed(title='Question:', description=question, color=0x2332e4, inline=False)
embed.add_field(name='Answer:', value=random.choice(responses), inline=False)
await ctx.send(embed=embed)

如果还有任何错误,请通过discord联系我!DrNano#9195

您也可以使用它!

@client.command(aliases=['insult me', 'plzinsult'])
async def insultme(ctx, *, question):
responses = ['You make it impossible to underestimate you', 'I may love to shop but i,myself, will never buy your bullshit.',]
embed = discord.Embed(title='Question:', description=random.choice(responses), color=0x2332e4, inline=False)
await ctx.send(embed=embed)

最新更新