From c0e1f55c016111e5f1560d1e6dc6abcb593f4609 Mon Sep 17 00:00:00 2001 From: blank X Date: Mon, 30 Nov 2020 10:35:12 +0700 Subject: [PATCH] Make info not puke a huge ass exception --- sukuinote/plugins/info.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sukuinote/plugins/info.py b/sukuinote/plugins/info.py index 13b25b2..3b6f2d3 100644 --- a/sukuinote/plugins/info.py +++ b/sukuinote/plugins/info.py @@ -38,7 +38,11 @@ async def info(client, message): entity = ' '.join(command) elif not getattr(message.reply_to_message, 'empty', True): entity = message.reply_to_message.from_user or message.reply_to_message.chat - entity, entity_client = await get_entity(client, entity) + try: + entity, entity_client = await get_entity(client, entity) + except Exception as ex: + await message.reply_text(f'{type(ex).__name__}: {str(ex)}', parse_mode=None) + return text_ping = _generate_sexy(entity, True) text_unping = _generate_sexy(entity, False) text_ping += f'\nID: {entity.id}'