DmitrMakeev
commited on
Commit
•
8e47aa9
1
Parent(s):
bcd8cb9
Update app.py
Browse files
app.py
CHANGED
@@ -1628,28 +1628,35 @@ def gc_forms():
|
|
1628 |
|
1629 |
|
1630 |
def verify_phone_number(phone_number):
|
1631 |
-
|
1632 |
|
1633 |
-
|
1634 |
-
"
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
|
|
|
|
|
|
1639 |
|
1640 |
-
|
1641 |
|
1642 |
-
|
1643 |
-
|
1644 |
-
print("Response Body:", response.text)
|
1645 |
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
|
|
|
|
|
|
|
|
1649 |
else:
|
1650 |
return False
|
1651 |
|
1652 |
|
|
|
1653 |
# Функция для добавления или обновления контакта в базе данных
|
1654 |
def add_or_update_contact(contact_data):
|
1655 |
conn = sqlite3.connect(DATABASE_NAME)
|
|
|
1628 |
|
1629 |
|
1630 |
def verify_phone_number(phone_number):
|
1631 |
+
verifikation_start = os.getenv('verifikation_start')
|
1632 |
|
1633 |
+
if verifikation_start == "1":
|
1634 |
+
full_url_ver = f"{wa_url}{wa_ak}{ws_url_ver}{wa_api_key}"
|
1635 |
+
|
1636 |
+
payload = json.dumps({
|
1637 |
+
"phoneNumber": phone_number
|
1638 |
+
})
|
1639 |
+
headers = {
|
1640 |
+
'Content-Type': 'application/json'
|
1641 |
+
}
|
1642 |
|
1643 |
+
response = requests.post(full_url_ver, headers=headers, data=payload)
|
1644 |
|
1645 |
+
print("Response Status Code:", response.status_code)
|
1646 |
+
print("Response Body:", response.text)
|
|
|
1647 |
|
1648 |
+
if response.status_code == 200:
|
1649 |
+
result = response.json()
|
1650 |
+
exists_whatsapp = result.get('existsWhatsapp', False)
|
1651 |
+
print("existsWhatsapp:", exists_whatsapp) # Вывод значения переменной
|
1652 |
+
return exists_whatsapp
|
1653 |
+
else:
|
1654 |
+
return False
|
1655 |
else:
|
1656 |
return False
|
1657 |
|
1658 |
|
1659 |
+
|
1660 |
# Функция для добавления или обновления контакта в базе данных
|
1661 |
def add_or_update_contact(contact_data):
|
1662 |
conn = sqlite3.connect(DATABASE_NAME)
|