nukdokplex / Telegram Python Webapp Validator
0 喜歡
0 分支
1 檔案
最後活躍
| 1 | from hmac import new as hmac_new |
| 2 | from hashlib import sha256 |
| 3 | from urllib.parse import unquote |
| 4 | |
| 5 | |
| 6 | def validate(init_data: str, token: str, c_str="WebAppData") -> None | dict[str, str]: |
| 7 | """Validates init data from webapp to check if a method was received from Telegram |
| 8 | Args: |
| 9 | init_data (str): init_data string received from webapp |
| 10 | token (str): token of bot that initiated webapp |
上一頁
下一頁