update rpc response format

This commit is contained in:
bakatrouble 2025-07-26 02:45:36 +03:00
parent 60c6448f72
commit fed68c0dfb

View File

@ -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)