This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Telegram/modules/commands/label.py

20 lines
642 B
Python
Raw Normal View History

2022-12-10 18:29:06 +02:00
from app import app
from pyrogram import filters
from modules.utils import should_quote, find_user
@app.on_message(~ filters.scheduled & filters.private & filters.command(["label"], prefixes=["/"]))
async def cmd_label(app, msg):
if len(msg.command) < 3:
await msg.reply_text("Invalid syntax:\n`/label USER NICKNAME`")
return
target = await find_user(app, msg.command[1])
if target is not None:
nickname = " ".join(msg.command[2:])
await msg.reply_text(f"Setting **{target.id}**'s label to **{nickname}**...", quote=should_quote(msg))
else:
await msg.reply_text(f"User not found")