azils3/bash
0
1# Ultroid - UserBot2# Copyright (C) 2021-2025 TeamUltroid3#4# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >5# PLease read the GNU Affero General Public License in6# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.7"""8✘ Commands Available -9 10• `{i}lock <msgs/media/sticker/gif/games/inline/polls/invites/pin/changeinfo>`11 Lock the Used Setting in Used Group.12 13• `{i}unlock <msgs/media/sticker/gif/games/inline/polls/invites/pin/changeinfo>`14 UNLOCK the Used Setting in Used Group.15"""16from telethon.tl.functions.messages import EditChatDefaultBannedRightsRequest17 18from pyUltroid.fns.admins import lock_unlock19 20from . import ultroid_cmd21 22 23@ultroid_cmd(24 pattern="(un|)lock( (.*)|$)", admins_only=True, manager=True, require="change_info"25)26async def un_lock(e):27 mat = e.pattern_match.group(2).strip()28 if not mat:29 return await e.eor("`Give some Proper Input..`", time=5)30 lock = e.pattern_match.group(1) == ""31 ml = lock_unlock(mat, lock)32 if not ml:33 return await e.eor("`Incorrect Input`", time=5)34 msg = "Locked" if lock else "Unlocked"35 try:36 await e.client(EditChatDefaultBannedRightsRequest(e.chat_id, ml))37 except Exception as er:38 return await e.eor(str(er))39 await e.eor(f"**{msg}** - `{mat}` ! ")40 