update for new channel-helper
This commit is contained in:
8
main.py
8
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})
|
r = await client.post(f'https://{subdomain}.bakatrouble.me/{upload_key}/photo', files={'upload': img_bytes})
|
||||||
logging.info(r.text)
|
logging.info(r.text)
|
||||||
resp = r.json()
|
resp = r.json()
|
||||||
result = resp.get('result')
|
status = resp.get('status')
|
||||||
if not result:
|
if not status:
|
||||||
raise Exception(f'No result in response: {resp}')
|
raise Exception(f'No result in response: {resp}')
|
||||||
elif result.get('status') == 'duplicate':
|
elif status == 'duplicate':
|
||||||
await cq.answer('Duplicate')
|
await cq.answer('Duplicate')
|
||||||
elif result.get('status') == 'ok':
|
elif status == 'ok':
|
||||||
await cq.answer('Sent')
|
await cq.answer('Sent')
|
||||||
else:
|
else:
|
||||||
raise Exception(resp)
|
raise Exception(resp)
|
||||||
|
Reference in New Issue
Block a user