add translation cache and queue
This commit is contained in:
12
utils.py
Normal file
12
utils.py
Normal 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}")
|
||||
Reference in New Issue
Block a user