added bot

This commit is contained in:
randogoth 2023-05-22 01:16:04 +03:00
parent df41d19f26
commit b87501e99f

View file

@ -1,9 +1,18 @@
import json import json
import os import os
import requests
from flask import Flask, request from flask import Flask, request
from waitress import serve from waitress import serve
from functools import reduce from functools import reduce
TOKEN = '5828518687:AAFxnEivg-SVL0OzAs2NrLiISKksjMLZq6M'
CHAT_ID = '26113616'
def send_msg(text):
url_req = "https://api.telegram.org/bot" + TOKEN + "/sendMessage" + "?chat_id=" + CHAT_ID + "&text=" + text + "&parse_mode=markdown&disable_web_page_preview=true"
return requests.get(url_req)
app = Flask(__name__) app = Flask(__name__)
@app.route("/track", methods = ['GET']) @app.route("/track", methods = ['GET'])
@ -30,6 +39,9 @@ def track():
'agent' : ua 'agent' : ua
} }
}) })
send_msg(f'User <{hash}> visited { url } on { ua }')
with open('db.json', 'w+') as dbw: with open('db.json', 'w+') as dbw:
dbw.write(json.dumps(db, indent=4)) dbw.write(json.dumps(db, indent=4))