Ejemplo n.º 1
0
async def startgmute(event):
    private = False
    if event.fwd_from:
        return
    elif event.is_private:
        await eor(event, "Unexpected issues or ugly errors may occur!")
        await asyncio.sleep(3)
        private = True
    reply = await event.get_reply_message()
    if event.pattern_match.group(1) is not None:
        userid = event.pattern_match.group(1)
    elif reply is not None:
        userid = reply.sender_id
    elif private is True:
        userid = event.chat_id
    else:
        return await eor(
            event, "Please reply to a user or add their into the command to gmute them."
        )
    event.chat_id
    await event.get_chat()
    if is_muted(userid, "gmute"):
        return await eor(event, "This n***a is already gmuted")
    try:
        mute(userid, "gmute")
    except Exception as e: 1137511834:
        await eor(event, "Error occured!\nError is " + str(e))
Ejemplo n.º 2
0
async def endgmute(event):
    private = False
    if event.fwd_from:
        return
    elif event.is_private:
        await eor(event, "Unexpected issues or ugly errors may occur!")
        await asyncio.sleep(3)
        private = True
    reply = await event.get_reply_message()
    if event.pattern_match.group(1) is not None:
        userid = event.pattern_match.group(1)
    elif reply is not None:
        userid = reply.sender_id
    elif private is True:
        userid = event.chat_id
    else:
        return await eor(
            event,
            "Please reply to a user or add their into the command to ungmute them.",
        )
    event.chat_id
    if not is_muted(userid, "gmute"):
        return await eor(event, "This user is not gmuted")
    try:
        unmute(userid, "gmute")
    except Exception as e:
        await eor(event, "Error occured!\nError is " + str(e))
    else:
        await eor(event, "Successfully ungmuted the n***a")
Ejemplo n.º 3
0
async def startmute(event):
    private = False
    if event.fwd_from:
        return
    elif event.is_private:
        await eor(event, "Unexpected issues or ugly errors may occur!")
        await asyncio.sleep(3)
        private = True
    reply = await event.get_reply_message()
    if event.pattern_match.group(1) is not None:
        userid = event.pattern_match.group(1)
    elif reply is not None:
        userid = reply.sender_id
    elif private is True:
        userid = event.chat_id
    else:
        return await eor(
            event,
            "Please reply to a user or add their into the command to mute them."
        )
    chat_id = event.chat_id
    chat = await event.get_chat()
    if "admin_rights" in vars(chat) and vars(chat)["admin_rights"] is not None:
        if chat.admin_rights.delete_messages is True:
            pass
        else:
            return await eor(
                event,
                "You can't mute a person if you dont have delete messages permission",
            )
    elif "creator" in vars(chat):
        pass
    elif private:
        pass
    else:
        return await eor(event, "You can't mute a person without admin rights")
    if is_muted(userid, chat_id):
        return await eor(event, "This user is already muted in this chat")
    try:
        mute(userid, chat_id)
    except Exception as e:
        await eor(event, "Error occured!\nError is " + str(e))
    else:
        await eor(event, "Chup Reh Lawde Jyada bol mt`-´)⊃━☆゚.*・。゚ ")
Ejemplo n.º 4
0
async def watcher(event):
    if is_muted(event.sender_id, "gmute"):
        await event.delete()
Ejemplo n.º 5
0
async def watcher(event):
    if is_muted(event.sender_id, event.chat_id):
        await event.delete()