From 7cda6478994abd1d396f1dd04864509ea24d7ec0 Mon Sep 17 00:00:00 2001 From: blank X Date: Fri, 13 Nov 2020 19:41:17 +0700 Subject: [PATCH] Fail even if error is none --- nhentai-comment-info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nhentai-comment-info.py b/nhentai-comment-info.py index 8a24791..33b1cb6 100644 --- a/nhentai-comment-info.py +++ b/nhentai-comment-info.py @@ -25,7 +25,7 @@ async def nhentai_comment_info(client, message): async with session.get(f'https://nhentai.net/api/gallery/{sauce}') as resp: info = await resp.json() text = f'{sauce}\n' - if info.get('error'): + if 'error' in info: text += f'Error: {html.escape(info.get("error"))}' else: text += 'Title: '