nizham icon

Untitled

nizham | PRO | 09/02/17 11:46:30 AM UTC | 0 ⭐ | 410 👁️ | Never ⏰ | []
Python |

3.45 KB

|

None

|

0 👍

/

0 👎

wait = {
    "copy":False,
    "copy2":"target",
    "target":{}
}
        elif msg.text in ["Copy o","copy o"]:
        if msg.from_ in admin:
                    wait["copy"] = True
                    cl.sendText(msg.to,"Copy on")
        else:
            cl.sendText(msg.to,"You are not a admins")
        elif msg.text in ["Copy c","copy c"]:
        if msg.from_ in admin:
                    wait["copy"] = False
                    cl.sendText(msg.to,"Copy off")
        else:
            cl.sendText(msg.to,"You are not a admins")
        elif msg.from_ in admin and wait["copy"] == True and wait["copy2"] == "me" and "Ccopy" not in msg.text:
        for i in range(1):
            cl.sendText(msg.to,msg.text)
            ki.sendText(msg.to,msg.text)
            kk.sendText(msg.to,msg.text)
            kc.sendText(msg.to,msg.text)
            ke.sendText(msg.to,msg.text)
            wait["copy"] = False
        wait["copy"] = True
        elif msg.from_ in wait["target"] and wait["copy"] == True and wait["copy2"] == "target":
        for i in range(1):
            cl.sendText(msg.to,msg.text)
            ki.sendText(msg.to,msg.text)
            kk.sendText(msg.to,msg.text)
            kc.sendText(msg.to,msg.text)
            ke.sendText(msg.to,msg.text)
            wait["copy"] = False
        wait["copy"] = True
        elif "Ccopy " in msg.text:
        if msg.from_ in admin:
            if wait["copy"] == True:
                siapa = msg.text.replace("Ccopy ","")
                if siapa.rstrip('  ') == "me":
                wait["copy2"] = "me"
                cl.sendText(msg.to,"Copy change to me")
                elif siapa.rstrip('  ') == "target":
                wait["copy2"] = "target"
                cl.sendText(msg.to,"Copy change to target")
                else:
                cl.sendText(msg.to,"I dont know")
            else:
            cl.sendText(msg.to,"Sorry, before using.. change Copy to on")
        else:
            cl.sendText(msg.to,"You are not a admins")
        elif "Target " in msg.text:
        if msg.from_ in admin:
            target = msg.text.replace("Target @","")
            gc = cl.getGroup(msg.to)
            targets = []
            for member in gc.members:
            if member.displayName == target.rstrip('  '):
                targets.append(member.mid)
            if targets == []:
            cl.sendText(msg.to, "User not found")
            else:
            for t in targets:
                wait["target"][t] = True
                        cl.sendText(msg.to,"Target added")
        else:
            cl.sendText(msg.to,"You are not a admins")
        elif "Del target " in msg.text:
        if msg.from_ in admin:
            target = msg.text.replace("Del target @","")
            gc = cl.getGroup(msg.to)
            targets = []
            for member in gc.members:
            if member.displayName == target.rstrip('  '):
                targets.append(member.mid)
            if targets == []:
            cl.sendText(msg.to, "User not found")
            else:
            for t in targets:
                del wait["target"][t]
                        cl.sendText(msg.to,"Target deleted")
        else:
            cl.sendText(msg.to,"You are not a admins")
            elif msg.text in ["Targetlist"]:
        if msg.from_ in admin:
                    if wait["target"] == {}:
                        cl.sendText(msg.to,"nothing")
                        ki.sendText(msg.to,"nothing")
                        kk.sendText(msg.to,"nothing")
                        kc.sendText(msg.to,"nothing")
            ke.sendText(msg.to,"nothing")
                    else:
                        mc = "Target copy user\n"
                        for mi_d in wait["target"]:
                            mc += "* "+cl.getContact(mi_d).displayName + "\n"
                        cl.sendText(msg.to,mc)
        else:
            cl.sendText(msg.to,"You are not a admins")

Comments