Files
mario_scraper/utils.py

13 lines
522 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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}")