Files
2026-08-15 00:28:08 +07:00

13 lines
525 B
Python

import json, requests
r = requests.get('https://api.telegram.org/bot5115036608:AAGeyXVq5eNvdAkaCQHU9NfH16uAAiSKiuk/getUpdates?timeout=5')
d = r.json()
print('ok:', d.get('ok'))
print('count:', len(d.get('result', [])))
for u in d.get('result', []):
types = [k for k in u if k != 'update_id']
print(f' update {u["update_id"]}: {types}')
if 'callback_query' in u:
cb = u['callback_query']
print(f' data: {cb.get("data","")}')
print(f' from: {cb.get("from",{}).get("first_name","")}')