This commit is contained in:
Alex55 2026-03-19 19:22:35 +02:00
parent 7c028e5069
commit ba21721af3
3 changed files with 20 additions and 1 deletions

18
API/TG.py Normal file
View File

@ -0,0 +1,18 @@
import requests
BOT_TOKEN = "8785472748:AAE16NRClF_3fe8HfJcsPVPBPPSq2CD_3Pw" # токен бота
CHAT_ID = "-1001889935010" # id чата
def send_telegram(text):
url = f"https://api.telegram.org/bot{BOT_TOKEN}/sendMessage"
response = requests.post(url, json={
"chat_id": CHAT_ID,
"text": text
})
return response.json()
send_telegram("TEST")

View File

@ -3,6 +3,7 @@ import sqlite3
import json
# from services.rokky import ones
# from API.rok import get_order_content
from API.TG import send_telegram
import logging
@ -29,7 +30,7 @@ def index1():
# всё остальное сохраняем как JSON
content = json.dumps(params, ensure_ascii=False)
send_telegram(content)
conn = sqlite3.connect(DB_PATH)
cursor = conn.cursor()