Also handle UserNotFoundError

This commit is contained in:
Profitroll 2022-12-15 15:02:56 +01:00
parent 2924c808dd
commit 3e2c301400

View File

@ -3,7 +3,7 @@ from app import app, isAnAdmin
from pyrogram import filters
from pyrogram.enums.parse_mode import ParseMode
from pyrogram.errors import bad_request_400
from classes.holo_user import HoloUser
from classes.holo_user import HoloUser, UserNotFoundError
from modules.utils import logWrite, locale, should_quote
from dateutil.relativedelta import relativedelta
from modules.database import col_applications
@ -18,7 +18,7 @@ async def cmd_application(app, msg):
try:
holo_user = HoloUser(int(msg.command[1]))
except ValueError:
except (ValueError, UserNotFoundError):
try:
holo_user = HoloUser((await app.get_users(msg.command[1])).id)
except bad_request_400.UsernameInvalid: