add translation cache and queue

This commit is contained in:
2025-05-29 13:53:25 +03:00
parent bcee61a817
commit 5b76a0dcbd
8 changed files with 307 additions and 24 deletions

12
utils.py Normal file
View File

@@ -0,0 +1,12 @@
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}")