async def on_command_error(ctx, error):
if isinstance(error, BotMissingPermissions):
await ctx.send("I dont have the permission to do that")``
不起作用,我猜這是因為我實際上遇到了錯誤,
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
但我找不到除此之外的方法
我也在全球范圍內進行,而不是按命令進行
uj5u.com熱心網友回復:
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, discord.Forbidden):
await ctx.send("I dont have the permission to do that")
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/343104.html
上一篇:Django-單元測驗物件已被洗掉-如何使用assertRaise/DoesNotExist例外
下一篇:MassTransit在ProcessingStartedState狀態期間未處理Step1FinishedEvent事件事件,因為StateMachine狀態機錯誤
