@commands.Cog.listener()
async def on_command_error(self, ctx, error):
    (await self.register_command(ctx))
    if (not isinstance(error, (commands.CommandInvokeError, commands.ConversionError))):
        return
    error = error.original
    if isinstance(error, (discord.Forbidden, discord.NotFound, CannotPaginate)):
        return
    e = discord.Embed(title='Command Error', colour=13382502)
    e.add_field(name='Name', value=ctx.command.qualified_name)
    e.add_field(name='Author', value=f'{ctx.author} (ID: {ctx.author.id})')
    fmt = f'Channel: {ctx.channel} (ID: {ctx.channel.id})'
    if ctx.guild:
        fmt = f'''{fmt}
Guild: {ctx.guild} (ID: {ctx.guild.id})'''
    e.add_field(name='Location', value=fmt, inline=False)
    e.add_field(name='Content', value=textwrap.shorten(ctx.message.content, width=512))
    exc = ''.join(traceback.format_exception(type(error), error, error.__traceback__, chain=False))
    e.description = f'''```py
{exc}
```'''
    e.timestamp = datetime.datetime.utcnow()
    (await self.webhook.send(embed=e))
@commands.Cog.listener()
async def on_command_error(self, ctx, error):
    (await self.register_command(ctx))
    if (not isinstance(error, (commands.CommandInvokeError, commands.ConversionError))):
        return
    error = error.original
    if isinstance(error, (discord.Forbidden, discord.NotFound, CannotPaginate)):
        return
    e = discord.Embed(title='Command Error', colour=13382502)
    e.add_field(name='Name', value=ctx.command.qualified_name)
    e.add_field(name='Author', value=f'{ctx.author} (ID: {ctx.author.id})')
    fmt = f'Channel: {ctx.channel} (ID: {ctx.channel.id})'
    if ctx.guild:
        fmt = f'{fmt}
Guild: {ctx.guild} (ID: {ctx.guild.id})'
    e.add_field(name='Location', value=fmt, inline=False)
    e.add_field(name='Content', value=textwrap.shorten(ctx.message.content, width=512))
    exc = .join(traceback.format_exception(type(error), error, error.__traceback__, chain=False))
    e.description = f'```py
{exc}
```'
    e.timestamp = datetime.datetime.utcnow()
    (await self.webhook.send(embed=e))