init commit

This commit is contained in:
prod-tech
2024-11-17 02:31:42 +03:00
commit cf933c770c
217 changed files with 19340 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import logging
import requests
from app.core.config import config
TELEGRAM_BOT_TOKEN = config.TOKEN_TELEGRAM_API
def send_telegram_message(chat_id: int, text: str):
url = f'https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage'
payload = {'chat_id': chat_id, 'text': text}
response = requests.post(url, json=payload)
if response.status_code != 200:
logging.error(f'Failed to send message to {chat_id}: {response.text}')