diff --git a/modules/commands/identify.py b/modules/commands/identify.py index daf7acf..6f83ed0 100644 --- a/modules/commands/identify.py +++ b/modules/commands/identify.py @@ -6,7 +6,7 @@ from pyrogram.client import Client from pyrogram.errors import bad_request_400 from pyrogram.enums.chat_action import ChatAction from classes.holo_user import HoloUser, UserNotFoundError, UserInvalidError -from modules.utils import jsonLoad, should_quote, logWrite, locale, download_tmp, create_tmp +from modules.utils import jsonLoad, should_quote, logWrite, locale, download_tmp, create_tmp, find_user from modules import custom_filters @app.on_message((custom_filters.enabled_applications | custom_filters.enabled_sponsorships) & ~filters.scheduled & filters.command("identify", prefixes=["/"]) & custom_filters.admin) @@ -20,8 +20,8 @@ async def command_identify(app: Client, msg: Message): try: holo_user = HoloUser(int(msg.command[1])) except ValueError: - holo_user = HoloUser(await app.get_users(msg.command[1])) - except (UserInvalidError, UserNotFoundError, bad_request_400.UsernameInvalid, bad_request_400.PeerIdInvalid, bad_request_400.UsernameNotOccupied): + holo_user = HoloUser(await find_user(app, msg.command[1])) + except (UserInvalidError, UserNotFoundError, bad_request_400.UsernameInvalid, bad_request_400.PeerIdInvalid, bad_request_400.UsernameNotOccupied, TypeError): await msg.reply_text(locale("identify_not_found", "message", locale=msg.from_user).format(msg.command[1])) return