init: workspace opencode sync
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import requests, json
|
||||
|
||||
# Get updates without offset
|
||||
r = requests.get('https://api.telegram.org/bot5115036608:AAGeyXVq5eNvdAkaCQHU9NfH16uAAiSKiuk/getUpdates')
|
||||
d = r.json()
|
||||
print(f"ok: {d.get('ok')}, count: {len(d.get('result',[]))}")
|
||||
msgs = [m for m in d['result'] if 'message' in m]
|
||||
for m in msgs[-10:]:
|
||||
mid = m['message']['message_id']
|
||||
cid = m['message']['chat']['id']
|
||||
txt = m['message'].get('text', m['message'].get('caption', ''))[:200]
|
||||
print(f" mid={mid} chat={cid} txt={txt}")
|
||||
|
||||
# Also check the test we sent
|
||||
print("\n--- Check laporkan group test ---")
|
||||
r2 = requests.get('https://api.telegram.org/bot5115036608:AAGeyXVq5eNvdAkaCQHU9NfH16uAAiSKiuk/getUpdates?offset=0&limit=100')
|
||||
d2 = r2.json()
|
||||
msgs2 = [m for m in d2['result'] if 'message' in m and m['message']['chat']['id'] == -1002554941429]
|
||||
print(f"Messages in laporkan: {len(msgs2)}")
|
||||
for m in msgs2[-5:]:
|
||||
print(f" mid={m['message']['message_id']} text={m['message'].get('text','')[:200]}")
|
||||
Reference in New Issue
Block a user