diff --git a/main.py b/main.py index 5fa3579..1ea55ea 100644 --- a/main.py +++ b/main.py @@ -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)