messages/_utils.py
def validate_whatsapp(attr, value):
    """WhatsApp input validator function."""
    if attr in ("from_", "to"):
        if value is not None and "whatsapp:" in value:
            value = value.split("whatsapp:+")[-1]
        check_valid(
            "WhatsApp",
            attr,
            value,
            validus.isint,
            "phone number starting with the '+' symbol",
        )
    elif attr in ("attachments"):
        check_valid("WhatsApp", attr, value, validus.isurl, "url")
def validate_whatsapp(attr, value):
    """WhatsApp input validator function."""
    if attr in ("from_", "to"):
        if value is not None and "whatsapp:" in value:
            value = value.split("whatsapp:+")[-1]
        check_valid(
            "WhatsApp",
            attr,
            value,
            validus.isint,
            "phone number starting with the '+' symbol",
        )
    elif attr in ("attachments"):
        check_valid("WhatsApp", attr, value, validus.isurl, "url")
WhatsApp input validator function.