13 lines
522 B
Python
13 lines
522 B
Python
import requests
|
||
|
||
TELEGRAM_TOKEN = "6452801861:AAHPzu1uvWzAznCVD905z7So-abg3R4wUKU"
|
||
TELEGRAM_CHAT_ID = "802473090" # можна отримати через @userinfobot
|
||
|
||
def notify_telegram(message: str):
|
||
try:
|
||
url = f"https://api.telegram.org/bot{TELEGRAM_TOKEN}/sendMessage"
|
||
data = {"chat_id": TELEGRAM_CHAT_ID, "text": message}
|
||
requests.post(url, data=data)
|
||
except Exception as e:
|
||
print(f"[ERROR] Не вдалося надіслати повідомлення в Telegram: {e}")
|