From fed68c0dfb96bb4e11da9fd9b3c2e167f393bff2 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Sat, 26 Jul 2025 02:45:36 +0300 Subject: [PATCH] update rpc response format --- main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index e99df22..4290b7e 100644 --- a/main.py +++ b/main.py @@ -358,10 +358,14 @@ async def send_callback(cq: CallbackQuery): "jsonrpc": "2.0", "id": 0, }) + logging.info(r.text) resp = r.json() - if resp.get('result') == 'duplicate': + result = resp.get('result') + if not result: + raise Exception(f'No result in response: {resp}') + if resp.get('status') == 'duplicate': await cq.answer('Duplicate') - elif resp.get('result'): + elif resp.get('status') == 'ok': await cq.answer('Sent') else: raise Exception(resp)