π¨βπ»
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
def checkValidateInitData(hash_str, init_data, token, c_str="WebAppData"): | |
""" | |
Validates the data received from the Telegram web app, using the | |
method documented here: | |
https://core.telegram.org/bots/webapps#validating-data-received-via-the-web-app | |
hash_str - the has string passed by the webapp | |
init_data - the query string passed by the webapp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
servers=json.loads(requests.get('https://single-developers.herokuapp.com/servers').content) | |
for server in servers: | |
id=str(server) | |
ip=servers[str(server)]['ip'] | |
location=servers[str(server)]['location'] | |
emoji=servers[str(server)]['emoji'] | |
print( |