我試圖為每種錯(cuò)誤類型創(chuàng)建專門的錯(cuò)誤,但我只能找到下面使用的 2 個(gè)錯(cuò)誤。有誰知道命令中的所有錯(cuò)誤事件類型@client.eventasync def on_command_error(ctx, error): if isinstance(error, commands.CommandOnCooldown): await ctx.message.delete() embed = discord.Embed(title="Slow Down!! :timer:", description='This command can be used again in %.2f seconds' % error.retry_after, color=0xE74C3C) message = await ctx.message.channel.send(embed=embed, delete_after=10) await asyncio.sleep(5) await message.delete() elif isinstance(error, commands.CommandNotFound): await ctx.message.delete() embed = discord.Embed(title="Uh oh!", description=f"Uh oh, {ctx.author.mention} what are you trying to do?? {error}!", color=0xE74C3C) message = await ctx.message.channel.send(embed=embed, delete_after=10) await asyncio.sleep(2)commandNotFound 和 CommandOnCooldown 是我能找到并工作的唯一類型,有人知道所有類型的列表嗎?我目前使用 on_command_error 但它不會(huì)具體向用戶解決問題是什么。謝謝,非常感謝
如何獲取所有 on_command_error 錯(cuò)誤事件的列表
動(dòng)漫人物
2024-01-24 15:23:20