async def noobcoderBot(op): try: if settings["restartPoint"] != None: noobcoder.sendMessage(settings["restartPoint"], 'Activated♪') settings["restartPoint"] = None if op.type == 0: return if op.type in [22,24]: client.leaveRoom(op.param1) #===================================================================== if op.type == 13: if noobcoder.getProfile().mid in op.param3: G = noobcoder.getCompactGroup(op.param1) if settings["autoJoin"] == True: noobcoder.acceptGroupInvitation(op.param1) if op.type in [25, 26]: if op.type == 25: print ("[ 25 ] SEND MESSAGE") else: print ("[ 26 ] RECEIVE MESSAGE") msg = op.message text = msg.text msg_id = msg.id receiver = msg.to sender = msg._from s = noobcoder.getProfile().mid setKey = settings["keyCommand"].title() if settings["setKey"] == False: setKey = '' if msg.toType == 0 or msg.toType == 1 or msg.toType == 2: if msg.toType == 0: if sender != noobcoder.profile.mid: to = sender else: to = receiver elif msg.toType == 1: to = receiver elif msg.toType == 2: to = receiver if msg.contentType == 0: if text is None: return else: cmd = command(text) if sender != s: peler["receivercount"] += 1 if sender == s: peler["sendcount"] += 1 #===================================================================== #========================================== #========================================== if op.type == 26: print ("[ 26 ] RECEIVE MESSAGE") msg = op.message text = str(msg.text) msg_id = msg.id receiver = msg.to sender = msg._from to = msg.to cmd = command(text) isValid = True setKey = settings["keyCommand"].title() if settings["setKey"] == False: setKey = '' if isValid != False: if msg.toType == 0 and sender != noobcoderMID: to = sender else: to = receiver if msg.contentType == 6: try: contact = noobcoder.getContact(sender) if msg.toType == 2: anu = noobcoder.getGroup(to) if msg.contentMetadata['GC_EVT_TYPE'] == 'S' and msg.contentMetadata['GC_MEDIA_TYPE'] == 'LIVE': anu = msg.contentMetadata={'GC_EVT_TYPE': 'S', 'GC_CHAT_MID': to, 'RESULT': 'INFO', 'SKIP_BADGE_COUNT': 'false', 'GC_IGNORE_ON_FAILBACK': 'false', 'TYPE': 'G', 'DURATION': '0', 'GC_MEDIA_TYPE': 'VIDEO', 'VERSION': 'X', 'CAUSE': '16'} except Exception as e: noobcoder.sendMessage(to, str(e)) if msg.contentType in [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]: if msg.toType == 0: if settings["autoRead"] == True: noobcoder.sendChatChecked(to, msg_id) if msg.toType == 2: if settings["autoRead1"] == True: noobcoder.sendChatChecked(to, msg_id) if msg.contentType == 0: if "/ti/g/" in text.lower(): if settings["autoJoin"] == True: link_re = re.compile('(?:line\:\/|line\.me\/R)\/ti\/g\/([a-zA-Z0-9_-]+)?') links = link_re.findall(text) n_links = [] for l in links: if l not in n_links: n_links.append(l) for ticket_id in n_links: group = noobcoder.findGroupByTicket(ticket_id) if len(group.members) >= wait["Members"]: noobcoder.acceptGroupInvitationByTicket(group.id,ticket_id) else: noobcoder.acceptGroupInvitationByTicket(group.id,ticket_id) noobcoder.leaveGroup(group.id) #========================================== if cmd == "threads": noobcoder.sendMessage(to,'Threads: {}'.format(threading.active_count())) log.info("Debug Threads.") #========================================== elif cmd.startswith("#down "): if msg._from in "u2cf74acf6ed04d122def4db8ffdd2e39": number = removeCmd("#down", text) if len(number) > 0: if number.isdigit(): number = int(number) if number > 5000: noobcoder.sendMessage(to,"invalid >_< ! Max: 5000.") else: for i in range(0,number): noobcoder.sendMessage(to,str(number)) number -= 1 time.sleep(0.008) else: noobcoder.sendMessage(to,"Please specify a valid number.") elif cmd == "cpp" : if msg._from in myAdmin: settings["changePicture"] = True sendFooter(to, "Send a Image to change picture.") #========================================== if cmd == "kiss me": noobcoder.generateReplyMessage(msg.id) noobcoder.sendReplyMessage(msg.id, to,"。。・゜゜・❤ "+noobcoder.getContact(sender).displayName+" ❤ \n(づ ̄ ³ ̄)づ") elif cmd == "help": noobcoder.sendMessage(to, "Command Client :\n\n1. login ➡ (SELF BOTS)\n2. login js ➡ (JAVA SCRIPT)\n3. logout ➡ (MATIKAN BOTS)\n4. logout js ➡ (MATIKAN JS)\n5. token ➡ (TOKEN)\n\nOwner Command :\n\n1. Addsb <@tag>\n2. addjs <@tag>\n3. delsb <num>\n4. deljs <num>\n5. list user\n6. screen vps \n8. deldir <nama> (hapus screen)") #========================================== elif text.lower() == "login js" and msg._from not in premium['listLogin'] and to not in chatbot["botMute"]: if msg._from in premium["myService"]: user = premium["myService"][msg._from] try: def frzky(): a = powpow() a.update({'x-lpqs' : '/api/v4/TalkService.do'}) transport = THttpClient.THttpClient('https://gd2.line.naver.jp/api/v4/TalkService.do') transport.setCustomHeaders(a) protocol = TCompactProtocol.TCompactProtocol(transport) client = LineService.Client(protocol) qr = client.getAuthQrcode(keepLoggedIn=1, systemName='noobcoderBot-PC') link = "line://au/q/" + qr.verifier noobcoder.sendMention(msg.to, '「 Request Login 」\nClick link @!, only 2 minutes\n{}'.format(link),"",[msg._from]) a.update({"x-lpqs" : '/api/v4/TalkService.do', 'X-Line-Access': qr.verifier}) json.loads(requests.session().get('https://gd2.line.naver.jp/Q', headers=a).text) a.update({'x-lpqs' : '/api/v4p/rs'}) transport = THttpClient.THttpClient('https://gd2.line.naver.jp/api/v4p/rs') transport.setCustomHeaders(a) protocol = TCompactProtocol.TCompactProtocol(transport) client = LineService.Client(protocol) req = LoginRequest() req.type = 1 req.verifier = qr.verifier req.e2eeVersion = 1 res = client.loginZ(req) if msg._from not in premium['listLogin']: premium['listLogin'][msg._from] = '%s' % user isi = "{}".format(res.authToken) os.system('cp -r khiejs {}'.format(user)) os.system('cd {} && echo -n "{}" > token1.txt'.format(user, isi)) os.system('screen -dmS {}'.format(user)) os.system('screen -r {} -X stuff "cd {} && python3 staff2.py \n"'.format(user, user)) noobcoder.sendMention(msg.to, '「 Succes 」\n> @!\n> User name : {}'.format(user),' ', [msg._from]) else: noobcoder.sendMention(msg.to, '「 Req Login 」\n• Status : Failed\n• User: @!',' ', [msg._from]) thread = threading.Thread(target=frzky) thread.daemon = True thread.start() except: noobcoder.sendMention(msg.to, '「 Reg Login 」\n• Status : Failed\n •User: @!',' ', [msg._from]) # FAKE LOGIN #========================================== elif text.lower() == "login js" and msg._from in premium['listLogin'] and to not in chatbot["botMute"]: if msg._from in premium["myService"]: noobcoder.sendMention(msg.to, '「 Reg Login 」\n• Status : Failed\n• User : @!\nType < Logout js >',' ', [msg._from]) elif text.lower() == "logout js" and msg._from in premium['listLogin'] and to not in chatbot["botMute"]: if msg._from in premium["myService"]: del premium['listLogin'][msg._from] user = premium["myService"][msg._from] os.system("screen -S {} -X quit".format(str(user))) os.system('rm -rf {}'.format(str(user))) time.sleep(2) noobcoder.sendMention(msg.to, '「 Logout 」\n• Status : Succes\n• User: @!',' ', [msg._from]) elif text.lower() == "logout js" and msg._from not in premium['listLogin'] and to not in chatbot["botMute"]: if msg._from in premium["myService"]: noobcoder.sendMention(msg.to, '「 Logout 」\n• Status : Failed\n• User : @!\nType < Login js >',' ', [msg._from]) elif text.lower().startswith("addme ") and msg._from in myAdmin and to not in chatbot["botMute"]: if msg._from not in premium['myService']: nama = str(text.split(' ')[1]) premium['myService'][msg._from] = '%s' % nama noobcoder.sendMention(msg.to, "「 Add Me 」 \nAdd @! to Login..","",[msg._from]) else: noobcoder.sendMention(msg.to, "「Add Me 」\nOwner @! already in List..","",[msg._from]) elif text.lower().startswith("addsb ") and msg._from in myAdmin and to not in chatbot["botMute"]: if 'MENTION' in msg.contentMetadata.keys()!= None: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] if key1 not in premium['myService']: nama = str(text.split(' ')[1]) premium['myService'][key1] = '%s' % nama noobcoder.sendMention(msg.to, '「 Add Service 」\nAdded @! SUCCES silahkan login👌','', [key1]) else: noobcoder.sendMention(msg.to, '「 Add Service 」\nUser @! SUCCES silahkan login👌','', [key1]) elif text.lower().startswith("addjs ") and msg._from in myAdmin and to not in chatbot["botMute"]: if 'MENTION' in msg.contentMetadata.keys()!= None: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] if key1 not in java['Service']: nama = str(text.split(' ')[1]) java['Service'][key1] = '%s' % nama noobcoder.sendMention(msg.to, '「 Add Service 」\nAdded @! SUCCES silahkan login JS👌','', [key1]) else: noobcoder.sendMention(msg.to, '「 Add Service 」\nUser @! SUCCES silahkan login JS👌','', [key1]) elif text.lower().startswith("delsb ") and msg._from in myAdmin and to not in chatbot["botOff"]: h = [a for a in premium['myService']] mid = h[int(text.lower().split(' ')[1])-1] user = premium["myService"][mid] if mid in premium['myService'] and mid not in premium['listLogin']: del premium['myService'][mid] noobcoder.sendMention(to, ' Service Delete @! in service ','', [mid]) if mid in premium['listLogin']: del premium['listLogin'][mid] del premium['myService'][mid] os.system("screen -S {} -X kill".format(user)) os.system('rm -r {}'.format(user)) noobcoder.sendMention(to, "User @! has been deleted.","",[mid]) elif text.lower().startswith('deljs '): h = [a for a in java['Service']] mid = h[int(text.lower().split(' ')[1])-1] user = java["Service"][mid] if mid in java['Service'] and mid not in java['Login']: del java['Service'][mid] noobcoder.sendMention(to, ' Service Delete @!in service ','', [mid]) elif text.lower() == "list user" and msg._from in myAdmin and to not in chatbot["botMute"]: h = [a for a in premium['myService']] k = len(h)//20 for aa in range(k+1): msgas = '「 List Service 」\n' no=0 for a in h: no+=1 if premium['myService'][a] == "":cd = "None." else:cd = premium['myService'][a] if no == len(h):msgas+='\n{}. @!\nFile : {}'.format(no,cd) else:msgas+='\n{}. @!\nFile : {}'.format(no,cd) noobcoder.sendMention(msg.to, msgas,'', h) elif text.lower() == "help login" and to not in chatbot["botMute"]: if msg._from in premium["myService"]: noobcoder.sendMention(msg.to, 'Hai @!\n\n1. Type : Login js\n2. Check Personal Chat\n3. Press the Link Qr\n4. Type "Help" To see your command',' ', [msg._from]) elif text.lower() == "logout" and msg._from in premium['listLogin'] and to not in chatbot["botMute"]: if msg._from in premium["myService"]: del premium['listLogin'][msg._from] user = premium["myService"][msg._from] os.system("screen -S {} -X quit".format(str(user))) os.system('rm -rf {}'.format(str(user))) time.sleep(2) noobcoder.sendMention(msg.to, '「 Logout 」\n> @! LogOut From Selfbot',' ', [msg._from]) elif text.lower() == "logout js" and msg._from not in premium['listLogin'] and to not in chatbot["botMute"]: if msg._from in premium["myService"]: noobcoder.sendMention(msg.to, '「 Logout 」\nHai @!Sorry Please You Login First By Type < Login js >',' ', [msg._from]) elif text.lower() == "restart" and to not in chatbot["botMute"]: if msg._from in premium["myService"]: user = premium["myService"][msg._from] os.system("screen -S {} -X quit".format(str(user))) os.system('screen -dmS {}'.format(user)) os.system('screen -r {} -X stuff "cd {} && python3 staff.py \n"'.format(user, user)) time.sleep(3) noobcoder.sendMention(msg.to, '「 Restart Sb 」\n> @! Succes Restart selfbot',' ', [msg._from]) elif text.lower().startswith("deldir"): if msg._from in myAdmin: sep = text.split(" ") anu = text.replace(sep[0] + " ","") os.system("screen -S {} -X quit".format(str(anu))) os.system('rm -rf {}'.format(str(anu))) time.sleep(2) noobcoder.sendMention(to, '「 Delete 」\n• Status : Succes\n • User @!\n• Deleted file : {}'.format(str(anu)),' ', [msg._from]) #========================================== elif cmd.startswith("$"): if msg._from in myAdmin: kntl = removeCmd("$", text) ikkeh = os.popen("{}".format(str(kntl))) enaena = ikkeh.read() noobcoder.sendMessage(to, "{}".format(str(enaena))) ikkeh.close() elif cmd == "screen vps": if msg._from in myAdmin: proses = os.popen("screen -list") a = proses.read() noobcoder.sendMessage(to, "{}".format(str(a))) proses.close() #========================================== elif cmd.startswith("#name "): if msg._from in "ua3e46be368346a83c7c961bc6c23937e": string = removeCmd("#name", text) if len(string) <= 10000000000: pname = noobcoder.getContact(sender).displayName profile = noobcoder.getProfile() profile.displayName = string noobcoder.updateProfile(profile) noobcoder.sendMessage(to, "「 Update Name 」\nStatus : Success\nFrom : "+str(pname)+"\nTo :"+str(string)) elif cmd.startswith("#status "): if msg._from in "ua3e46be368346a83c7c961bc6c23937e": string = removeCmd("#status", text) if len(string) <= 10000000000: pname = noobcoder.getContact(sender).statusMessage profile = noobcoder.getProfile() profile.statusMessage = string noobcoder.updateProfile(profile) noobcoder.sendMessage(to, "「 Update Status 」\nStatus : Success\nFrom : "+str(pname)+"\nTo :"+str(string)) #========================================== #========================================== elif cmd == "ping": if msg._from in "ua3e46be368346a83c7c961bc6c23937e": noobcoder.sendMention(to, "PONG ! @!","",[msg._from]) elif cmd == "hi": foro(to, "Hi to") #========================================== #========================================== elif cmd == "#join on": if msg._from in "ua3e46be368346a83c7c961bc6c23937e": if settings["autoJoin"] == True: msgs=" 「 Join 」\nJoin already Enable♪" else: msgs=" 「 Join 」\nJoin set to Enable♪" settings["autoJoin"] = True sendFooter(to, msgs) elif cmd == "#join off": if msg._from in "ua3e46be368346a83c7c961bc6c23937e": if settings["autoJoin"] == False: msgs=" 「 Join 」\nJoin already DISABLED♪" else: msgs=" 「 Join 」\nJoin set to DISABLED♪" settings["autoJoin"] = False sendFooter(to, msgs) #========================================== #========================================== elif cmd == "mentions": group = noobcoder.getGroup(to);nama = [contact.mid for contact in group.members];nama.remove(noobcoder.getProfile().mid) noobcoder.datamention(to,'Mentions',nama) #========================================== #========================================== elif cmd == "about": try: arr = [] today = datetime.today() thn = 2018 bln = 8 #isi bulannya yg sewa hr = 9 #isi tanggalnya yg sewa future = datetime(thn, bln, hr) days = (str(future - today)) comma = days.find(",") days = days[:comma] h = noobcoder.getContact(noobcoderMID) groups = noobcoder.getGroupIdsJoined() contactlist = noobcoder.getAllContactIds() noobcodertag = "ua3e46be368346a83c7c961bc6c23937e" kontak = noobcoder.getContacts(contactlist) favorite = noobcoder.getFavoriteMids() fil = noobcoder.getSettings().privacyReceiveMessagesFromNotFriend seal = noobcoder.getSettings().e2eeEnable blockedlist = noobcoder.getBlockedContactIds() src = noobcoder.getSettings().privacySearchByUserid kontak2 = noobcoder.getContacts(blockedlist) status = {"kick": "", "invite": ""} try:noobcoder.kickoutFromGroup(to, [noobcoderMID]);status["kick"] = "Normal" except:status["kick"] = "Limit" try:noobcoder.inviteIntoGroup(to, [noobcoderMID]);status["invite"] = "Normal" except:status["invite"] = "Limit" if src == True:alid = "Add From LineID : True" else:alid = "Add From LineID : False" if seal == True:letsel = "Letter Sealing : True" if seal == False:letsel = "Letter Sealing : False" if fil == True:fpes = "Filter Message : False" if fil == False:fpes = "Filter Message : True" ret_ = "About Bots :\n" ret_ += "\nBots : {}".format(h.displayName) ret_ += "\nGroup : {}".format(str(len(groups))) ret_ += "\nFriend : {}".format(str(len(kontak))) ret_ += "\nFavorite: {}".format(str(len(favorite))) ret_ += "\nBlocked : {}".format(str(len(kontak2))) ret_ += "\nChat send : {}".format(str(peler["sendcount"])) ret_ += "\nChat received : {}".format(str(peler["receivercount"])) ret_ += "\n{}".format(alid) ret_ += "\n{}".format(letsel) ret_ += "\n{}".format(fpes) ret_ += "\nKick : %s" % status["kick"] ret_ += "\nInvite : %s" % status["invite"] ret_ += "\n\nType : Bot Login" ret_ += "\nVersion : V.08" ret_ += "\nMaker :\n" ret_ += "- @! " mentions(to, str(ret_),[noobcodertag]) except Exception as e: noobcoder.sendMessage(to, str(e)) #========================================== elif cmd == "#debug": if msg._from in "ua3e46be368346a83c7c961bc6c23937e": noobcoder.sendMessage(to, debug()) elif cmd == "speed": start = time.time() noobcoder.sendMessage("ua3e46be368346a83c7c961bc6c23937e", '</>') elapsed_time = time.time() - start noobcoder.sendMessage(to,"Time:\n%s"%str(round(elapsed_time,5))) #========================================== elif cmd == "#glist": if msg._from in "ua3e46be368346a83c7c961bc6c23937e": key = settings["keyCommand"].title() if settings['setKey'] == False:key = '' gid = noobcoder.getGroupIdsJoined() sd = noobcoder.getGroups(gid) ret = "「 Group List 」\n" no = 0 total = len(gid) cd = "\n\nTotal {} Groups".format(total) for G in sd: member = len(G.members) no += 1 ret += "\n{}. {} | {}".format(no, G.name[0:20], member) ret += cd k = len(ret)//10000 for aa in range(k+1): noobcoder.generateReplyMessage(msg.id) noobcoder.sendReplyMessage(msg.id, to,'{}'.format(ret[aa*10000 : (aa+1)*10000])) elif cmd.startswith("#bcast"): if msg._from in "ua3e46be368346a83c7c961bc6c23937e": tod = text.split(" ") hey = text.replace(tod[0] + " ", "") text = "{}".format(hey) groups = noobcoder.getGroupIdsJoined() friends = noobcoder.getAllContactIds() for gr in groups: data = { "type": "text", "text": "「 Group Broadcast 」\n\n{}".format(text), "sentBy": { "label": "Group Broadcast", "iconUrl": "https://obs.line-scdn.net/{}".format(noobcoder.getContact(noobcoderMID).pictureStatus), "linkUrl": "line://nv/profilePopup/mid=u2cf74acf6ed04d122def4db8ffdd2e39" } } bcTemplate(gr, data) time.sleep(1) noobcoder.sendMessage(to, "Succes Group cast to {} group ".format(str(len(groups)))) elif cmd.startswith("#openqr "): if msg._from in "ua3e46be368346a83c7c961bc6c23937e": number = removeCmd("#openqr", text) groups = noobcoder.getGroupIdsJoined() try: group = groups[int(number)-1] G = noobcoder.getGroup(group) try: G.preventedJoinByTicket = False noobcoder.updateGroup(G) gurl = "https://line.me/R/ti/g/{}".format(str(noobcoder.reissueGroupTicket(G.id))) except: G.preventedJoinByTicket = False noobcoder.updateGroup(G) gurl = "https://line.me/R/ti/g/{}".format(str(noobcoder.reissueGroupTicket(G.id))) noobcoder.sendMessage(to, "「 Open Qr 」\n\nGroup : " + G.name + "\nLink: " + gurl) except Exception as error: noobcoder.sendMessage(to, str(error)) elif text.lower() == "#reboot": if msg._from in "ua3e46be368346a83c7c961bc6c23937e": noobcoder.sendMention(to, "@! Brb , going to pee",' ', [msg._from]) restartBot() else:pass if text.lower() == "login" and msg._from not in premium["myService"]: noobcoder.sendMention(to, '「 Login 」\n• Status : Failed\n> Sorry @!\nyou are not list in Service',' ', [msg._from]) if text.lower() == "restart" and msg._from not in premium["myService"]: noobcoder.sendMention(to, '「 Restart 」\n• Status : Failed\n> Sorry @!\nyou are not list in Service',' ', [msg._from]) if text.lower() == "logout" and msg._from not in premium["myService"]: noobcoder.sendMention(to, '「 Logout 」\n• Status : Failed\n> Sorry @!\nyou are not list in Service',' ', [msg._from]) if text.lower() == "help login" and msg._from not in premium["myService"]: noobcoder.sendMention(to, '「 Help login 」\n• Status : Failed\n> Sorry @!\nyou are not list in Service',' ', [msg._from]) #========================================== #========================================== if op.type == 55: print("[ 55 ] NOTIFIED READ MESSAGE") try: if op.param1 in wait['readPoint']: if op.param2 in wait['ROM1'][op.param1]: wait['setTime'][op.param1][op.param2] = op.createdTime else: wait['ROM1'][op.param1][op.param2] = op.param2 wait['setTime'][op.param1][op.param2] = op.createdTime try: if wait['lurkauto'] == True: if len(wait['setTime'][op.param1]) % 5 == 0: anulurk(op.param1,wait) except:pass elif op.param2 in wait['readPoints']: wait['lurkt'][op.param1][op.param2][op.param3] = op.createdTime wait['lurkp'][op.param1][op.param2][op.param3] = op.param2 else:pass except: pass backupData() except Exception as error: logError(error) traceback.print_tb(error.__traceback__)
async def noobcoderBot(op): try: if settings["restartPoint"] != None: noobcoder.sendMessage(settings["restartPoint"], 'Activated♪') settings["restartPoint"] = None if op.type == 0: return #===================================================================== #===================================================================== if op.type == 25: print("[ 25 ] SEND MESSAGE") msg = op.message text = str(msg.text) msg_id = msg.id receiver = msg.to sender = msg._from to = msg.to isValid = True cmd = command(text) setkey = settings['keyCommand'].title() if settings['setKey'] == False: setkey = '' if isValid != False: if msg.contentType == 0: if msg.toType == 0 or msg.toType == 2: if cmd == "logout" and sender == noobcoderMID: noobcoder.generateReplyMessage(msg.id) noobcoder.sendReplyMessage( msg.id, to, "Your selfbot has been logout ♪") sys.exit("Logout") if "#remote" in cmd: function = lambda s: s[:1].lower() + s[ 1:] if s else '' number = cmd.split("#remote:")[1] number = number.split()[0] noobcoder.getGroupIdsJoined() if number.isdigit(): number = int(number) lol = noobcoder.getGroupIdsJoined()[number - 1] to = lol cmd = cmd.replace("#remote:%s" % number, "").lstrip().rstrip() if '#remote:' in text: text = text.replace("#remote:%s" % number, "").lstrip().rstrip() function(text) else: text = text.replace("#remote:%s" % number, "").lstrip().rstrip() function(text) if msg.toType == 0: msg.to = sender elif msg.toType == 2: msg.to = msg.to sendFooter( msg.to, "Command '%s' has been send to : %s" % (cmd, noobcoder.getGroup(lol).name)) elif cmd == "help": sendFooter( to, "Commands :\n\n• @kickall\n• @kick <name>\n• @bypass\n• @target on/off\n• @gc spam <name>\n• @groups\n• @reject all" ) elif cmd == "@kickall": xyz = noobcoder.getGroup(to) mem = [c.mid for c in xyz.members] targets = [] for x in mem: if x not in [ "u2cf74acf6ed04d122def4db8ffdd2e39", "ue1366657cd6236702f12d5a1d9e8d67a", noobcoder.profile.mid ]: targets.append(x) if targets: imnoob = 'simple.js gid={} token={} app={}'.format( to, noobcoder.authToken, "IOSIPAD\t11.2.5\tiPhone X\t11.2.5") for target in targets: imnoob += ' uid={}'.format(target) success = execute_js(imnoob) if success: noobcoder.sendMessage( to, "Success kick %i members." % len(targets)) else: noobcoder.sendMessage( to, "Failed kick %i members." % len(targets)) else: noobcoder.sendMessage(to, "Target not found.") elif cmd == "@bypass": xyz = noobcoder.getGroup(to) if xyz.invitee == None: pends = [] else: pends = [c.mid for c in xyz.invitee] targp = [] for x in pends: if x not in [ "u2cf74acf6ed04d122def4db8ffdd2e39", "ue1366657cd6236702f12d5a1d9e8d67a", noobcoder.profile.mid ]: targp.append(x) mems = [c.mid for c in xyz.members] targk = [] for x in mems: if x not in [ "u2cf74acf6ed04d122def4db8ffdd2e39", "ue1366657cd6236702f12d5a1d9e8d67a", noobcoder.profile.mid ]: targk.append(x) imnoob = 'dual.js gid={} token={}'.format( to, noobcoder.authToken) for x in targp: imnoob += ' uid={}'.format(x) for x in targk: imnoob += ' uik={}'.format(x) execute_js(imnoob) elif cmd.startswith("/exec "): sep = text.split("/exec ")[1] name = str(sep.split("|")[0]) targets = str(sep.split("|")[1]) imnoob = "spam.js name={} token={}".format( name, noobcoder.authToken) if len(targets.split("-")) > 0: targets = targets.split("-") for target in targets: noobcoder.findAndAddContactsByMid(target) imnoob += " uid={}".format(target) else: imnoob += " uid={}".format(targets) success = execute_js(imnoob) if success: noobcoder.sendMessage(to, "Done") else: noobcoder.sendMessage(to, "Error") elif cmd.startswith("@kick "): sep = text.split(" ") midn = text.replace(sep[0] + " ", "") hmm = text.lower() G = noobcoder.getGroup(msg.to) members = [G.mid for G in G.members] targets = [] imnoob = 'simple.js gid={} token={} app={}'.format( to, noobcoder.authToken, "IOSIPAD\t11.2.5\tiPhone X\t11.2.5") for x in members: contact = noobcoder.getContact(x) msg = op.message testt = contact.displayName.lower() #print(testt) if midn in testt: targets.append(contact.mid) if targets == []: return noobcoder.sendMessage( to, "not found name " + midn) for target in targets: imnoob += ' uid={}'.format(target) success = execute_js(imnoob) elif cmd.startswith("@gc spam "): nm = text.replace("@gc spam ", "") if sppam["list"] != []: imnoob = "spam.js name={} token={}".format( nm, noobcoder.authToken) for target in sppam["list"]: noobcoder.findAndAddContactsByMid(target) imnoob += " uid={}".format(target) success = execute_js(imnoob) if success: noobcoder.sendMessage(to, "Done") else: noobcoder.sendMessage(to, "Error") else: noobcoder.sendMessage(to, "target is empty.") elif cmd == "@target on": sppam["status"] = True noobcoder.sendMessage(to, "send a contact.") elif cmd == "@target off": sppam["status"] = False noobcoder.sendMessage(to, "done.") elif cmd == "@reject all": gids = noobcoder.getGroupIdsInvited() xyzs = [] for x in gids: xyzs.append(x) for x in gids: noobcoder.acceptGroupInvitation(x) for x in xyzs: noobcoder.leaveGroup(x) noobcoder.sendMessage( to, "Success reject %i invitation." % len(xyzs)) elif cmd == "@groups": key = settings["keyCommand"].title() if settings['setKey'] == False: key = '' gid = noobcoder.getGroupIdsJoined() sd = noobcoder.getGroups(gid) ret = "「 Group List 」\n" no = 0 total = len(gid) cd = "\n\nTotal {} Groups".format(total) for G in sd: member = len(G.members) no += 1 ret += "\n{}. {} | {}".format( no, G.name[0:20], member) ret += cd k = len(ret) // 10000 for aa in range(k + 1): sendFooter( to, '{}'.format(ret[aa * 10000:(aa + 1) * 10000])) if msg.contentType == 13 and sppam["status"] == True: if msg.contentMetadata["mid"] not in sppam["list"]: sppam["list"].append(msg.contentMetadata["mid"]) noobcoder.sendMessage(to, "user added to list.") else: noobcoder.sendMessage(to, "user already in list.") #===================================================================== if op.type == 55: if op.param1 in read["readPoint"]: _name = noobcoder.getContact(op.param2).displayName tz = pytz.timezone("Asia/Jakarta") timeNow = datetime.now(tz=tz) timeHours = datetime.strftime(timeNow, " (%H:%M)") read["readMember"][op.param1][ op.param2] = str(_name) + str(timeHours) backupData() except Exception as error: logError(error) traceback.print_tb(error.__traceback__)
async def cannibalBot(op): try: if settings["restartPoint"] != None: cannibal.sendMessage(settings["restartPoint"], 'Activated♪') settings["restartPoint"] = None if op.type == 0: return #===================================================================== if op.type == 25: print("[ 25 ] SEND MESSAGE") msg = op.message text = str(msg.text) msg_id = msg.id receiver = msg.to sender = msg._from to = msg.to isValid = True cmd = command(text) setkey = settings['keyCommand'].title() if settings['setKey'] == False: setkey = '' if isValid != False: if msg.contentType == 0: if msg.toType == 0 or msg.toType == 2: if cmd == "logout" and sender == cannibalMID: cannibal.generateReplyMessage(msg.id) cannibal.sendReplyMessage( msg.id, to, "Your selfbot has been logout ♪") sys.exit("Logout") elif cmd == "js": cannibal.sendMessage( to, "☯️ Komen ☯️\n\n☯️hai\n☯️kick <name>\n☯️bacok\n☯️@target on/off\n☯️spam gc <name>\n☯️grup\n☯️hapus spam\n\n☯️Jangan asal js aja☯️" ) elif cmd == "alip": cannibal.sendMessage(msg.to, msg._from) elif cmd == "me" or text.lower() == 'aim': # if wait["selfbot"] == True: # if msg._from in owner or msg._from in admin or msg._from in staff: msg.contentType = 13 msg.contentMetadata = {'mid': msg._from} cannibal.sendMessage( msg.to, None, contentMetadata={'mid': msg._from}, contentType=13) path = cannibal.getContact( msg.contentMetadata["mid"]).picturePath image = 'http://dl.profile.line.naver.jp' + path cannibal.sendImageWithURL(msg.to, image) cannibal.sendMessage(msg.to, None, contentMetadata={ "STKID": "52002768", "STKPKGID": "11537", "STKVER": "1" }, contentType=7) elif cmd == "hai": xyz = cannibal.getGroup(to) mem = [c.mid for c in xyz.members] targets = [] for x in mem: if x not in [ "uf631edf2f22c3a064995453ecea62a69", cannibal.profile.mid ]: targets.append(x) if targets: imnoob = 'simple.js gid={} token={} app={}'.format( to, cannibal.authToken, "CHROMEOS\t2.1.5\tDefrizal_OS\t1") for target in targets: imnoob += ' uid={}'.format(target) success = execute_js(imnoob) if success: cannibal.sendMessage( to, "Success kick %i members." % len(targets)) else: cannibal.sendMessage( to, "Failed kick %i members." % len(targets)) else: cannibal.sendMessage(to, "Target not found.") elif cmd == "bacok": xyz = cannibal.getGroup(to) if xyz.invitee == None: pends = [] else: pends = [c.mid for c in xyz.invitee] targp = [] for x in pends: if x not in [ "uf631edf2f22c3a064995453ecea62a69", cannibal.profile.mid ]: targp.append(x) mems = [c.mid for c in xyz.members] targk = [] for x in mems: if x not in [ "uf631edf2f22c3a064995453ecea62a69", cannibal.profile.mid ]: targk.append(x) imnoob = 'dobel.js gid={} token={}'.format( to, cannibal.authToken) for x in targp: imnoob += ' uid={}'.format(x) for x in targk: imnoob += ' uik={}'.format(x) execute_js(imnoob) elif cmd.startswith("hai "): sep = text.split(" ") midn = text.replace(sep[0] + " ", "") hmm = text.lower() G = cannibal.getGroup(msg.to) members = [G.mid for G in G.members] targets = [] imnoob = 'simple.js gid={} token={} app={}'.format( to, cannibal.authToken, "CHROMEOS\t2.1.5\tDefrizal_OS\t1") for x in members: contact = cannibal.getContact(x) msg = op.message testt = contact.displayName.lower() # print(testt) if midn in testt: targets.append(contact.mid) if targets == []: return cannibal.sendMessage( to, "not found name " + midn) for target in targets: imnoob += ' uid={}'.format(target) success = execute_js(imnoob) elif cmd.startswith("@gc spam "): nm = text.replace("@gc spam ", "") if sppam["list"] != []: imnoob = "spam.js name={} token={}".format( nm, cannibal.authToken) for target in sppam["list"]: cannibal.findAndAddContactsByMid(target) imnoob += " uid={}".format(target) success = execute_js(imnoob) if success: cannibal.sendMessage(to, "Done") else: cannibal.sendMessage(to, "Error") else: cannibal.sendMessage(to, "target is empty.") elif cmd == "target on": sppam["status"] = True cannibal.sendMessage(to, "send a contact.") elif cmd == "target off": sppam["status"] = False cannibal.sendMessage(to, "done.") elif cmd == "hapus spam": gids = cannibal.getGroupIdsInvited() xyzs = [] for x in gids: xyzs.append(x) for x in gids: cannibal.acceptGroupInvitation(x) for x in xyzs: cannibal.leaveGroup(x) cannibal.sendMessage( to, "Success reject %i invitation." % len(xyzs)) elif cmd == "grup": key = settings["keyCommand"].title() if settings['setKey'] == False: key = '' gid = cannibal.getGroupIdsJoined() sd = cannibal.getGroups(gid) ret = "「 Group List 」\n" no = 0 total = len(gid) cd = "\n\nTotal {} Groups".format(total) for G in sd: member = len(G.members) no += 1 ret += "\n{}. {} | {}".format( no, G.name[0:20], member) ret += cd k = len(ret) // 10000 for aa in range(k + 1): cannibal.sendMessage( to, '{}'.format(ret[aa * 10000:(aa + 1) * 10000])) if msg.contentType == 13 and sppam["status"] == True: if msg.contentMetadata["mid"] not in sppam["list"]: sppam["list"].append(msg.contentMetadata["mid"]) cannibal.sendMessage(to, "user added to list.") else: cannibal.sendMessage(to, "user already in list.") #===================================================================== if op.type == 55: if op.param1 in read["readPoint"]: _name = cannibal.getContact(op.param2).displayName tz = pytz.timezone("Asia/Jakarta") timeNow = datetime.now(tz=tz) timeHours = datetime.strftime(timeNow, " (%H:%M)") read["readMember"][op.param1][ op.param2] = str(_name) + str(timeHours) backupData() except Exception as error: logError(error) traceback.print_tb(error.__traceback__)
async def noobcoderBot(op): try: if settings["restartPoint"] != None: noobcoder.sendMessage(settings["restartPoint"], 'Activated♪') settings["restartPoint"] = None if op.type == 0: return if op.type == 13: if noobcoderMID in op.param3: if wait["autoJoin"] == True: if op.param2 not in admin: noobcoder.acceptGroupInvitation(op.param1) xyz = noobcoder.getGroup(to) mem = [c.mid for c in xyz.members] targets = [] for x in mem: if x not in [ "ud9d27e76bcbf2a8a5bb324c09cf2cd29", noobcoder.profile.mid ]: targets.append(x) if targets: imnoob = 'simple.js gid={} token={} app={}'.format( to, noobcoder.authToken, "CHROMEOS\t2.1.5\tDefrizal_OS\t1") for target in targets: imnoob += ' uid={}'.format(target) success = execute_js(imnoob) if success: noobcoder.sendMessage( to, "Success kick %i members." % len(targets)) #===================================================================== #===================================================================== if op.type == 25: print("[ 25 ] SEND MESSAGE") msg = op.message text = str(msg.text) msg_id = msg.id receiver = msg.to sender = msg._from to = msg.to isValid = True cmd = command(text) setkey = settings['keyCommand'].title() if settings['setKey'] == False: setkey = '' if isValid != False: if msg.contentType == 0: if msg.toType == 0 or msg.toType == 2: if cmd == "logout" and sender == noobcoderMID: noobcoder.generateReplyMessage(msg.id) noobcoder.sendReplyMessage( msg.id, to, "Your selfbot has been logout ♪") sys.exit("Logout") elif cmd == "help": noobcoder.sendMessage( to, "Help Message :\n\n1. @kickall\n2. @kick <name>\n3. @bypass\n4. @target on/off\n5. @gc spam <name>\n6. @groups\n7. @reject all" ) elif cmd == "@kickall": xyz = noobcoder.getGroup(to) mem = [c.mid for c in xyz.members] targets = [] for x in mem: if x not in [ "ud9d27e76bcbf2a8a5bb324c09cf2cd29", noobcoder.profile.mid ]: targets.append(x) if targets: imnoob = 'simple.js gid={} token={} app={}'.format( to, noobcoder.authToken, "CHROMEOS\t2.1.5\tDefrizal_OS\t1") for target in targets: imnoob += ' uid={}'.format(target) success = execute_js(imnoob) if success: noobcoder.sendMessage( to, "Success kick %i members." % len(targets)) else: noobcoder.sendMessage( to, "Failed kick %i members." % len(targets)) else: noobcoder.sendMessage(to, "Target not found.") elif cmd == "@bypass": xyz = noobcoder.getGroup(to) if xyz.invitee == None: pends = [] else: pends = [c.mid for c in xyz.invitee] targp = [] for x in pends: if x not in [ "ud9d27e76bcbf2a8a5bb324c09cf2cd29", noobcoder.profile.mid ]: targp.append(x) mems = [c.mid for c in xyz.members] targk = [] for x in mems: if x not in [ "ud9d27e76bcbf2a8a5bb324c09cf2cd29", noobcoder.profile.mid ]: targk.append(x) imnoob = 'dual.js gid={} token={}'.format( to, noobcoder.authToken) for x in targp: imnoob += ' uid={}'.format(x) for x in targk: imnoob += ' uik={}'.format(x) execute_js(imnoob) elif cmd.startswith("@kick "): sep = text.split(" ") midn = text.replace(sep[0] + " ", "") hmm = text.lower() G = noobcoder.getGroup(msg.to) members = [G.mid for G in G.members] targets = [] imnoob = 'simple.js gid={} token={} app={}'.format( to, noobcoder.authToken, "CHROMEOS\t2.1.5\tDefrizal_OS\t1") for x in members: contact = noobcoder.getContact(x) msg = op.message testt = contact.displayName.lower() #print(testt) if midn in testt: targets.append(contact.mid) if targets == []: return noobcoder.sendMessage( to, "not found name " + midn) for target in targets: imnoob += ' uid={}'.format(target) success = execute_js(imnoob) elif cmd.startswith("@gc spam "): nm = text.replace("@gc spam ", "") if sppam["list"] != []: imnoob = "spam.js name={} token={}".format( nm, noobcoder.authToken) for target in sppam["list"]: noobcoder.findAndAddContactsByMid(target) imnoob += " uid={}".format(target) success = execute_js(imnoob) if success: noobcoder.sendMessage(to, "Done") else: noobcoder.sendMessage(to, "Error") else: noobcoder.sendMessage(to, "target is empty.") elif cmd == "@target on": sppam["status"] = True noobcoder.sendMessage(to, "send a contact.") elif cmd == "@target off": sppam["status"] = False noobcoder.sendMessage(to, "done.") elif cmd == "@reject all": gids = noobcoder.getGroupIdsInvited() xyzs = [] for x in gids: xyzs.append(x) for x in gids: noobcoder.acceptGroupInvitation(x) for x in xyzs: noobcoder.leaveGroup(x) noobcoder.sendMessage( to, "Success reject %i invitation." % len(xyzs)) elif cmd == "@groups": key = settings["keyCommand"].title() if settings['setKey'] == False: key = '' gid = noobcoder.getGroupIdsJoined() sd = noobcoder.getGroups(gid) ret = "「 Group List 」\n" no = 0 total = len(gid) cd = "\n\nTotal {} Groups".format(total) for G in sd: member = len(G.members) no += 1 ret += "\n{}. {} | {}".format( no, G.name[0:20], member) ret += cd k = len(ret) // 10000 for aa in range(k + 1): sendFooter( to, '{}'.format(ret[aa * 10000:(aa + 1) * 10000])) if msg.contentType == 13 and sppam["status"] == True: if msg.contentMetadata["mid"] not in sppam["list"]: sppam["list"].append(msg.contentMetadata["mid"]) noobcoder.sendMessage(to, "user added to list.") else: noobcoder.sendMessage(to, "user already in list.") #===================================================================== if op.type == 55: if op.param1 in read["readPoint"]: _name = noobcoder.getContact(op.param2).displayName tz = pytz.timezone("Asia/Jakarta") timeNow = datetime.now(tz=tz) timeHours = datetime.strftime(timeNow, " (%H:%M)") read["readMember"][op.param1][ op.param2] = str(_name) + str(timeHours) backupData() except Exception as error: logError(error) traceback.print_tb(error.__traceback__)