diff --git a/sukuinote/plugins/einfo.py b/sukuinote/plugins/einfo.py index 38f43aa..63386c8 100644 --- a/sukuinote/plugins/einfo.py +++ b/sukuinote/plugins/einfo.py @@ -174,11 +174,13 @@ async def get_cas(entity): return f'- XXX: {html.escape(json.get("description", "XXX"))}' async def get_spam_protection(entity): - async with session.get(f'https://api.intellivoid.net/spamprotection/v1/lookup?query={entity}') as resp: - try: + status = 500 + try: + async with session.get(f'https://api.intellivoid.net/spamprotection/v1/lookup?query={entity}') as resp: + status = resp.staus json = await resp.json() - except BaseException as ex: - return f'- {resp.status}: {html.escape(type(ex).__name__)}: {html.escape(str(ex))}' + except BaseException as ex: + return f'- {status}: {html.escape(type(ex).__name__)}: {html.escape(str(ex))}' if json['success']: text = '' if json['results']['private_telegram_id']: