added bot
This commit is contained in:
parent
df41d19f26
commit
b87501e99f
1 changed files with 12 additions and 0 deletions
12
userdb/db.py
12
userdb/db.py
|
|
@ -1,9 +1,18 @@
|
|||
import json
|
||||
import os
|
||||
import requests
|
||||
from flask import Flask, request
|
||||
from waitress import serve
|
||||
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.route("/track", methods = ['GET'])
|
||||
|
|
@ -30,6 +39,9 @@ def track():
|
|||
'agent' : ua
|
||||
}
|
||||
})
|
||||
|
||||
send_msg(f'User <{hash}> visited { url } on { ua }')
|
||||
|
||||
with open('db.json', 'w+') as dbw:
|
||||
dbw.write(json.dumps(db, indent=4))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue