Make info not puke a huge ass exception

This commit is contained in:
blank X 2020-11-30 10:35:12 +07:00
parent 55d41e65cc
commit c0e1f55c01
1 changed files with 5 additions and 1 deletions

View File

@ -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
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'\n<b>ID:</b> <code>{entity.id}</code>'