213145
This commit is contained in:
parent
7c028e5069
commit
ba21721af3
|
|
@ -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")
|
||||||
Binary file not shown.
|
|
@ -3,6 +3,7 @@ import sqlite3
|
||||||
import json
|
import json
|
||||||
# from services.rokky import ones
|
# from services.rokky import ones
|
||||||
# from API.rok import get_order_content
|
# from API.rok import get_order_content
|
||||||
|
from API.TG import send_telegram
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -29,7 +30,7 @@ def index1():
|
||||||
|
|
||||||
# всё остальное сохраняем как JSON
|
# всё остальное сохраняем как JSON
|
||||||
content = json.dumps(params, ensure_ascii=False)
|
content = json.dumps(params, ensure_ascii=False)
|
||||||
|
send_telegram(content)
|
||||||
conn = sqlite3.connect(DB_PATH)
|
conn = sqlite3.connect(DB_PATH)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue