EX01 / VideoEncoder /plugins /add_sudo.py
appniru2's picture
Sync from GitHub via hub-sync
11fa042 verified
Raw
History Blame Contribute Delete
506 Bytes
from pyrogram import Client, filters
from ..utils.helper import check_chat, get_id
from ..svcs.status_svc import add_sudo_user
@Client.on_message(filters.command('addsudo'))
async def add_sudo_handler(app, message):
if not await check_chat(message, chat='Sudo'):
return
target_id = get_id(message)
success, text = await add_sudo_user(target_id)
status = "● Success" if success else "✗ Failed"
await message.reply(f"▸ <b>Sudo</b>\nStatus: {status}\n{text}")