Files
Ultroid-fork/plugins/locks.py
Danish 68839e9dd0 Ultroid v0.0.7 2021/05/22
Co-authored-by: New-dev0 <New-dev0@notavailable.live>
Co-authored-by: Danish <danish@ultroid.tech>
Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com>
Co-authored-by: Programming Error <error@notavailable.live>
Co-authored-by: Aakash <BLUE-DEVIL1134@users.noreply.github.com>
Co-authored-by: Aditya <me@xditya.me>
Co-authored-by: sppidy <sppidy@users.noreply.github.com>
Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com>
Co-authored-by: divkix <divkix@users.noreply.github.com>
Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com>
2021-05-22 22:21:41 +05:30

52 lines
1.6 KiB
Python

# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
• `{i}lock <msgs/media/sticker/gif/games/inline/polls/invites/pin/changeinfo>`
Lock the Used Setting in Used Group.
• `{i}unlock <msgs/media/sticker/gif/games/inline/polls/invites/pin/changeinfo>`
UNLOCK the Used Setting in Used Group.
"""
from pyUltroid.functions.all import lucks, unlucks
from telethon.tl.functions.messages import EditChatDefaultBannedRightsRequest
from . import *
@ultroid_cmd(pattern="lock ?(.*)", groups_only=True, admins_only=True)
async def lockho(e):
mat = e.pattern_match.group(1)
if not mat:
return await eod(e, "`What to Lock ?`")
try:
ml = lucks(mat)
except BaseException:
return await eod(e, "`Incorrect Input`")
await ultroid_bot(EditChatDefaultBannedRightsRequest(e.chat_id, ml))
await eor(e, f"Locked - `{mat}` ! ")
@ultroid_cmd(pattern="unlock ?(.*)", groups_only=True, admins_only=True)
async def unlckho(e):
mat = e.pattern_match.group(1)
if not mat:
return await eod(e, "`What to Lock ?`")
try:
ml = unlucks(mat)
except BaseException:
return await eod(e, "`Incorrect Input`")
await ultroid_bot(EditChatDefaultBannedRightsRequest(e.chat_id, ml))
await eor(e, f"Unlocked - `{mat}` ! ")
HELP.update({f"{__name__.split('.')[1]}": f"{__doc__.format(i=HNDLR)}"})