Fixed label length on set

This commit is contained in:
Profitroll
2022-12-22 22:11:15 +01:00
parent 95e9fdf460
commit 7db8c9ac5c
4 changed files with 9 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
from app import app, isAnAdmin
from pyrogram import filters
from modules.utils import should_quote, find_user
from modules.utils import locale, should_quote, find_user
from classes.holo_user import HoloUser
@app.on_message(~ filters.scheduled & filters.private & filters.command(["label"], prefixes=["/"]))
@@ -25,6 +25,9 @@ async def cmd_label(app, msg):
await msg.reply_text(f"Resetting **{target.id}**'s label...", quote=should_quote(msg))
else:
if len(label) > 16:
await msg.reply_text(locale("label_too_long", "message"))
return
await target.set_label(msg.chat, label)
await msg.reply_text(f"Setting **{target.id}**'s label to **{label}**...", quote=should_quote(msg))