def on_command_error(error, ctx):
if isinstance(error, commands.NoPrivateMessage):
await ctx.author.send('This command cannot be used in private messages.')
elif isinstance(error, commands.DisabledCommand):
await ctx.channel.send(':x: Dieser Command wurde deaktiviert')
elif isinstance(error, commands.CommandInvokeError):
if bot.dev:
raise error
else:
embed = discord.Embed(title=':x: Command Error', colour=0x992d22) #Dark Red
embed.add_field(name='Error', value=error)
embed.add_field(name='Guild', value=ctx.guild)
embed.add_field(name='Channel', value=ctx.channel)
embed.add_field(name='User', value=ctx.author)
embed.add_field(name='Message', value=ctx.message.clean_content)
embed.timestamp = datetime.datetime.utcnow()
try:
await bot.owner.send(embed=embed)
except:
pass
评论列表
文章目录