LabelSettingError added

This commit is contained in:
Profitroll
2023-01-05 20:46:47 +01:00
parent 57518399a1
commit 59dafc004d
2 changed files with 10 additions and 4 deletions

View File

@@ -2,8 +2,8 @@ from app import app
from pyrogram import filters
from pyrogram.types import Message
from pyrogram.client import Client
from modules.utils import locale, should_quote, find_user
from classes.holo_user import HoloUser, LabelTooLongError
from modules.utils import configGet, locale, should_quote, find_user
from classes.holo_user import HoloUser, LabelTooLongError, LabelSettingError
from modules import custom_filters
# Label command ================================================================================================================
@@ -32,6 +32,9 @@ async def cmd_label(app: Client, msg: Message):
except LabelTooLongError:
await msg.reply_text(locale("label_too_long", "message"))
return
except LabelSettingError as exp:
await app.send_message(configGet("admin", "groups"), exp.__str__(), disable_notification=True)
return
await msg.reply_text(f"Setting **{target.id}**'s label to **{label}**...", quote=should_quote(msg))
else: