async def METHOD_NAME(event: lightbulb.CommandErrorEvent) -> None:
    """Error handler for the bot."""
    # Unwrap the exception to get the original cause
    exc = event.exception.__cause__ or event.exception
    ctx = event.context
    if not ctx.bot.rest.is_alive:
        return
    if isinstance(event.exception, lightbulb.CommandInvocationError):
        if not event.context.command:
            await _send_error_embed("Something went wrong", exc, ctx)
        else:
            await _send_error_embed(
                f"Something went wrong during invocation of command `{event.context.command.name}`.", exc, ctx
            )
        raise event.exception
    # Not an owner
    if isinstance(exc, lightbulb.NotOwner):
        await _send_error_embed("You are not the owner of this bot.", exc, ctx)
    # Command is on cooldown
    elif isinstance(exc, lightbulb.CommandIsOnCooldown):
        await _send_error_embed(f"This command is on cooldown. Retry in `{exc.retry_after:.2f}` seconds.", exc, ctx)
    # Missing permissions
    elif isinstance(exc, lightbulb.errors.MissingRequiredPermission):
        await _send_error_embed(
            f"You do not have permission to use this command. Missing permissions: {exc.missing_perms}", exc, ctx
        )
    # Missing roles
    elif isinstance(exc, lightbulb.errors.MissingRequiredRole):
        assert event.context.guild_id is not None  # Roles only exist in guilds
        await _send_error_embed(
            f"You do not have the correct role to use this command. Missing role(s): {[mention(r, 'role') for r in exc.missing_roles]}",
            exc,
            ctx,
        )
    # Only a guild command
    elif isinstance(exc, lightbulb.errors.OnlyInGuild):
        await _send_error_embed("This command can only be run in servers.", exc, ctx)
    # Only a DM command
    elif isinstance(exc, lightbulb.errors.OnlyInDM):
        await _send_error_embed("This command can only be run in DMs.", exc, ctx)
    # Not enough arguments
    elif isinstance(exc, lightbulb.errors.NotEnoughArguments):
        await _send_error_embed(
            f"Not enough arguments were supplied to the command. {[opt.name for opt in exc.missing_options]}", exc, ctx
        )
    # Bot missing permission
    elif isinstance(exc, lightbulb.errors.BotMissingRequiredPermission):
        await _send_error_embed(
            f"The bot does not have the correct permission(s) to execute this command. Missing permissions: {exc.missing_perms}",
            exc,
            ctx,
        )
    elif isinstance(exc, lightbulb.errors.MissingRequiredAttachment):
        await _send_error_embed("Not enough attachments were supplied to this command.", exc, ctx)
    elif isinstance(exc, lightbulb.errors.CommandNotFound):
        await ctx.respond(f"`/{exc.invoked_with}` is not a valid command. Use `/help` to see a list of commands.")
    else:
        raise exc