update for new channel-helper

This commit is contained in:
2025-08-09 23:03:48 +03:00
parent f1684edef8
commit 1b88ad2ac8

View File

@@ -370,12 +370,12 @@ async def send_callback(cq: CallbackQuery):
r = await client.post(f'https://{subdomain}.bakatrouble.me/{upload_key}/photo', files={'upload': img_bytes})
logging.info(r.text)
resp = r.json()
result = resp.get('result')
if not result:
status = resp.get('status')
if not status:
raise Exception(f'No result in response: {resp}')
elif result.get('status') == 'duplicate':
elif status == 'duplicate':
await cq.answer('Duplicate')
elif result.get('status') == 'ok':
elif status == 'ok':
await cq.answer('Sent')
else:
raise Exception(resp)