init: workspace opencode sync
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
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","")}')
|
||||
Reference in New Issue
Block a user