亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何獲取所有 on_command_error 錯誤事件的列表

如何獲取所有 on_command_error 錯誤事件的列表

動漫人物 2024-01-24 15:23:20
我試圖為每種錯誤類型創建專門的錯誤,但我只能找到下面使用的 2 個錯誤。有誰知道命令中的所有錯誤事件類型@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 但它不會具體向用戶解決問題是什么。謝謝,非常感謝
查看完整描述

1 回答

?
慕村225694

TA貢獻1880條經驗 獲得超4個贊

通過一些研究,您可以輕松地從 API 參考中找到所有錯誤。是所有命令錯誤異常。



查看完整回答
反對 回復 2024-01-24
  • 1 回答
  • 0 關注
  • 130 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號