Also handle UserNotFoundError
This commit is contained in:
parent
2924c808dd
commit
3e2c301400
@ -3,7 +3,7 @@ from app import app, isAnAdmin
|
|||||||
from pyrogram import filters
|
from pyrogram import filters
|
||||||
from pyrogram.enums.parse_mode import ParseMode
|
from pyrogram.enums.parse_mode import ParseMode
|
||||||
from pyrogram.errors import bad_request_400
|
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 modules.utils import logWrite, locale, should_quote
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
from modules.database import col_applications
|
from modules.database import col_applications
|
||||||
@ -18,7 +18,7 @@ async def cmd_application(app, msg):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
holo_user = HoloUser(int(msg.command[1]))
|
holo_user = HoloUser(int(msg.command[1]))
|
||||||
except ValueError:
|
except (ValueError, UserNotFoundError):
|
||||||
try:
|
try:
|
||||||
holo_user = HoloUser((await app.get_users(msg.command[1])).id)
|
holo_user = HoloUser((await app.get_users(msg.command[1])).id)
|
||||||
except bad_request_400.UsernameInvalid:
|
except bad_request_400.UsernameInvalid:
|
||||||
|
Reference in New Issue
Block a user