Added LabelTooLongError() and changed names

This commit is contained in:
Profitroll
2022-12-22 22:11:36 +01:00
parent 7db8c9ac5c
commit 12da1b2376
4 changed files with 13 additions and 6 deletions

View File

@@ -21,14 +21,14 @@ async def cmd_label(app, msg):
label = " ".join(msg.command[2:])
if label.lower() == "reset":
await target.reset_label(msg.chat)
await target.label_reset(msg.chat)
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 target.label_set(msg.chat, label)
await msg.reply_text(f"Setting **{target.id}**'s label to **{label}**...", quote=should_quote(msg))
else: