nickname is now label

This commit is contained in:
Profitroll 2022-12-11 23:31:12 +01:00
parent 3aefe710e5
commit 5af5bea805

View File

@ -10,7 +10,7 @@ async def cmd_label(app, msg):
if msg.chat.id == configGet("admin_group") or await isAnAdmin(msg.from_user.id): if msg.chat.id == configGet("admin_group") or await isAnAdmin(msg.from_user.id):
if len(msg.command) < 3: if len(msg.command) < 3:
await msg.reply_text("Invalid syntax:\n`/label USER NICKNAME`") await msg.reply_text("Invalid syntax:\n`/label USER LABEL`")
return return
target = await find_user(app, msg.command[1]) target = await find_user(app, msg.command[1])
@ -19,15 +19,15 @@ async def cmd_label(app, msg):
target = HoloUser(target) target = HoloUser(target)
nickname = " ".join(msg.command[2:]) label = " ".join(msg.command[2:])
if nickname.lower() == "reset": if label.lower() == "reset":
await target.reset_label(app, msg.chat) await target.reset_label(msg.chat)
await msg.reply_text(f"Resetting **{target.id}**'s label...", quote=should_quote(msg)) await msg.reply_text(f"Resetting **{target.id}**'s label...", quote=should_quote(msg))
else: else:
await target.set_label(app, msg.chat, nickname) await target.set_label(msg.chat, label)
await msg.reply_text(f"Setting **{target.id}**'s label to **{nickname}**...", quote=should_quote(msg)) await msg.reply_text(f"Setting **{target.id}**'s label to **{label}**...", quote=should_quote(msg))
else: else:
await msg.reply_text(f"User not found") await msg.reply_text(f"User not found")