├── LINETCR ├── .DS_Store ├── Api │ ├── LineTracer.py │ ├── Poll.py │ ├── Talk.py │ ├── __init__.py │ └── channel.py ├── LineApi.py ├── __init__.py └── lib │ ├── .DS_Store │ ├── __init__.py │ └── curve │ ├── LineService.py │ ├── __init__.py │ ├── constants.py │ └── ttypes.py ├── README.md └── treebot.py /LINETCR/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Treerach/SelfBot/e32dbb37441d9f465ae76e901c4bd4b21ac26f16/LINETCR/.DS_Store -------------------------------------------------------------------------------- /LINETCR/Api/LineTracer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from .LineClient import LineClient 4 | from types import * 5 | from ..lib.curve.ttypes import OpType 6 | from ..Net.LineServer import url 7 | 8 | 9 | class LineTracer(object): 10 | OpInterrupt = {} 11 | client = None 12 | 13 | def __init__(self, client): 14 | if type(client) is not LineClient: 15 | raise Exception( 16 | "You need to set LineClient instance to initialize LineTracer") 17 | 18 | self.client = client 19 | self.client.endPoint(url.LONG_POLLING) 20 | 21 | def addOpInterruptWithDict(self, OpInterruptDict): 22 | """To add Operation with Callback function {Optype.NOTIFIED_INTO_GROUP: func}""" 23 | self.OpInterrupt.update(OpInterruptDict) 24 | 25 | def addOpInterrupt(self, OperationType, DisposeFunc): 26 | self.OpInterrupt[OperationType] = DisposeFunc 27 | 28 | def execute(self): 29 | try: 30 | operations = self.client.fetchOperation(self.client.revision, 10) 31 | #print "=======================================================" 32 | # print operations 33 | #print "=======================================================" 34 | except EOFError: 35 | return 36 | except KeyboardInterrupt: 37 | exit() 38 | except: 39 | return 40 | 41 | for op in operations: 42 | if op.type in self.OpInterrupt.keys(): 43 | #print "=======================================================" 44 | #print str(op.type) + "[" + str(op) + "]" 45 | #print "=======================================================" 46 | self.OpInterrupt[op.type](op) 47 | 48 | self.client.revision = max(op.revision, self.client.revision) 49 | -------------------------------------------------------------------------------- /LINETCR/Api/Poll.py: -------------------------------------------------------------------------------- 1 | import os, sys, time 2 | path = os.path.join(os.path.dirname(__file__), '../lib/') 3 | sys.path.insert(0, path) 4 | 5 | from thrift.transport import THttpClient 6 | from thrift.protocol import TCompactProtocol 7 | 8 | from curve import LineService 9 | from curve.ttypes import * 10 | 11 | class Poll: 12 | 13 | client = None 14 | 15 | auth_query_path = "/api/v4/TalkService.do"; 16 | http_query_path = "/S4"; 17 | polling_path = "/P4"; 18 | host = "gd2.line.naver.jp"; 19 | port = 443; 20 | 21 | UA = "Line/6.0.0 iPad4,1 9.0.2" 22 | LA = "DESKTOPMAC 10.10.2-YOSEMITE-x64 MAC 4.5.0" 23 | 24 | rev = 0 25 | 26 | def __init__(self, authToken): 27 | self.transport = THttpClient.THttpClient('https://gd2.line.naver.jp:443'+ self.http_query_path) 28 | self.transport.setCustomHeaders({ 29 | "User-Agent" : self.UA, 30 | "X-Line-Application" : self.LA, 31 | "X-Line-Access": authToken 32 | }); 33 | self.protocol = TCompactProtocol.TCompactProtocol(self.transport); 34 | self.client = LineService.Client(self.protocol) 35 | self.rev = self.client.getLastOpRevision() 36 | self.transport.path = self.polling_path 37 | self.transport.open() 38 | 39 | def stream(self, sleep=50000): 40 | #usleep = lambda x: time.sleep(x/1000000.0) 41 | while True: 42 | try: 43 | Ops = self.client.fetchOps(self.rev, 5) 44 | except EOFError: 45 | raise Exception("It might be wrong revision\n" + str(self.rev)) 46 | 47 | for Op in Ops: 48 | # print Op.type 49 | if (Op.type != OpType.END_OF_OPERATION): 50 | self.rev = max(self.rev, Op.revision) 51 | return Op 52 | 53 | #usleep(sleep) 54 | -------------------------------------------------------------------------------- /LINETCR/Api/Talk.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os, sys 3 | path = os.path.join(os.path.dirname(__file__), '../lib/') 4 | sys.path.insert(0, path) 5 | 6 | import requests, rsa 7 | 8 | from thrift.transport import THttpClient 9 | from thrift.protocol import TCompactProtocol 10 | 11 | from curve import LineService 12 | from curve.ttypes import * 13 | 14 | class Talk: 15 | client = None 16 | 17 | auth_query_path = "/api/v4/TalkService.do"; 18 | http_query_path = "/S4"; 19 | wait_for_mobile_path = "/Q"; 20 | host = "gd2.line.naver.jp"; 21 | port = 443; 22 | 23 | UA = "Line/6.0.0 iPad4,1 9.0.2" 24 | LA = "DESKTOPMAC 10.10.2-YOSEMITE-x64 MAC 4.5.0" 25 | 26 | authToken = None 27 | cert = None 28 | 29 | def __init__(self): 30 | self.transport = THttpClient.THttpClient('https://gd2.line.naver.jp:443'+self.auth_query_path) 31 | self.transport.setCustomHeaders({ 32 | "User-Agent" : self.UA, 33 | "X-Line-Application" : self.LA, 34 | }) 35 | self.transport.open() 36 | self.protocol = TCompactProtocol.TCompactProtocol(self.transport); 37 | self.client = LineService.Client(self.protocol) 38 | 39 | def login(self, mail, passwd, cert=None, callback=None): 40 | self.transport.path = self.auth_query_path 41 | rsakey = self.client.getRSAKeyInfo(IdentityProvider.LINE) 42 | crypt = self.__crypt(mail, passwd, rsakey) 43 | 44 | result = self.client.loginWithIdentityCredentialForCertificate( 45 | IdentityProvider.LINE, 46 | rsakey.keynm, 47 | crypt, 48 | True, 49 | '127.0.0.1', 50 | 'http://dg.b9dm.com/KoenoKatachi.mp4', 51 | cert 52 | ) 53 | 54 | if result.type == 3: 55 | callback(result.pinCode) 56 | header = {"X-Line-Access": result.verifier} 57 | r = requests.get(url="https://" + self.host + self.wait_for_mobile_path, headers=header) 58 | 59 | result = self.client.loginWithVerifierForCerificate(r.json()["result"]["verifier"]) 60 | self.transport.setCustomHeaders({ 61 | "X-Line-Application" : self.LA, 62 | "User-Agent" : self.UA, 63 | "X-Line-Access" : result.authToken 64 | }) 65 | 66 | self.authToken = result.authToken 67 | self.cert = result.certificate 68 | self.transport.path = self.http_query_path 69 | 70 | elif result.type == 1: 71 | self.authToken = result.authToken 72 | self.cert = result.certificate 73 | self.transport.setCustomHeaders({ 74 | "X-Line-Application" : self.LA, 75 | "User-Agent" : self.UA, 76 | "X-Line-Access" : result.authToken 77 | }) 78 | self.transport.path = self.http_query_path 79 | 80 | def TokenLogin(self, authToken): 81 | self.transport.setCustomHeaders({ 82 | "X-Line-Application" : self.LA, 83 | "User-Agent" : self.UA, 84 | "X-Line-Access" : authToken, 85 | }) 86 | self.authToken = authToken 87 | self.transport.path = self.http_query_path 88 | 89 | def qrLogin(self, callback): 90 | self.transport.path = self.auth_query_path 91 | 92 | qr = self.client.getAuthQrcode(True, "Ŧяәәƅoŧ") 93 | callback("Copy to Line and Click\nYour LINK QR is: line://au/q/" + qr.verifier) 94 | 95 | r = requests.get("https://" + self.host + self.wait_for_mobile_path, headers={ 96 | "X-Line-Application": self.LA, 97 | "X-Line-Access": qr.verifier, 98 | }) 99 | 100 | vr = r.json()["result"]["verifier"] 101 | lr = self.client.loginWithVerifierForCerificate(vr) 102 | self.transport.setCustomHeaders({ 103 | "X-Line-Application" : self.LA, 104 | "User-Agent" : self.UA, 105 | "X-Line-Access": lr.authToken 106 | }) 107 | self.authToken = lr.authToken 108 | self.cert = lr.certificate 109 | self.transport.path = self.http_query_path 110 | 111 | 112 | def __crypt(self, mail, passwd, RSA): 113 | message = (chr(len(RSA.sessionKey)) + RSA.sessionKey + 114 | chr(len(mail)) + mail + 115 | chr(len(passwd)) + passwd).encode('utf-8') 116 | 117 | pub_key = rsa.PublicKey(int(RSA.nvalue, 16), int(RSA.evalue, 16)) 118 | crypto = rsa.encrypt(message, pub_key).encode('hex') 119 | 120 | return crypto 121 | -------------------------------------------------------------------------------- /LINETCR/Api/__init__.py: -------------------------------------------------------------------------------- 1 | from Talk import Talk 2 | from Poll import Poll 3 | from channel import Channel 4 | -------------------------------------------------------------------------------- /LINETCR/Api/channel.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os, sys, json 3 | path = os.path.join(os.path.dirname(__file__), '../lib/') 4 | sys.path.insert(0, path) 5 | import requests 6 | 7 | from thrift.transport import THttpClient 8 | from thrift.protocol import TCompactProtocol 9 | 10 | from curve import LineService 11 | from curve.ttypes import * 12 | import tempfile 13 | 14 | class Channel: 15 | client = None 16 | 17 | host = "gd2.line.naver.jp" 18 | http_query_path = "/S4" 19 | channel_query_path = "/CH4" 20 | 21 | UA = "Line/6.0.0 iPad4,1 9.0.2" 22 | LA = "DESKTOPMAC 10.10.2-YOSEMITE-x64 MAC 4.5.0" 23 | 24 | authToken = None 25 | mid = None 26 | channel_access_token = None 27 | token = None 28 | obs_token = None 29 | refresh_token = None 30 | 31 | def __init__(self, authToken): 32 | self.authToken = authToken 33 | self.transport = THttpClient.THttpClient('https://gd2.line.naver.jp:443'+self.http_query_path) 34 | self.transport.setCustomHeaders({ "User-Agent" : self.UA, 35 | "X-Line-Application" : self.LA, 36 | "X-Line-Access": self.authToken 37 | }) 38 | self.transport.open() 39 | self.protocol = TCompactProtocol.TCompactProtocol(self.transport) 40 | self.client = LineService.Client(self.protocol) 41 | self.mid = self.client.getProfile().mid 42 | self.transport.path = self.channel_query_path 43 | 44 | def login(self): 45 | result = self.client.issueChannelToken("1341209950") 46 | 47 | self.channel_access_token = result.channelAccessToken 48 | self.token = result.token 49 | self.obs_token = result.obsToken 50 | self.refresh_token = result.refreshToken 51 | 52 | print "channelAccessToken:" + result.channelAccessToken 53 | print "token:" + result.token 54 | print "obs_token:" + result.obsToken 55 | print "refreshToken:" + result.refreshToken 56 | 57 | def new_post(self, text): 58 | 59 | header = { 60 | "Content-Type": "application/json", 61 | "User-Agent" : self.UA, 62 | "X-Line-Mid" : self.mid, 63 | "x-lct" : self.channel_access_token, 64 | } 65 | 66 | payload = { 67 | "postInfo" : { "readPermission" : { "type" : "ALL" } }, 68 | "sourceType" : "TIMELINE", 69 | "contents" : { "text" : text } 70 | } 71 | 72 | r = requests.post( 73 | "http://" + self.host + "/mh/api/v24/post/create.json", 74 | headers = header, 75 | data = json.dumps(payload) 76 | ) 77 | 78 | return r.json() 79 | 80 | def postPhoto(self,text,path): 81 | header = { 82 | "Content-Type": "application/json", 83 | "User-Agent" : self.UA, 84 | "X-Line-Mid" : self.mid, 85 | "x-lct" : self.channel_access_token, 86 | } 87 | 88 | payload = { 89 | "postInfo" : { "readPermission" : { "type" : "ALL" } }, 90 | "sourceType" : "TIMELINE", 91 | "contents" : { "text" : text ,"media" : [{u'objectId': u'F57144CF9ECC4AD2E162E68554D1A8BD1a1ab0t04ff07f6'}]} 92 | } 93 | r = requests.post( 94 | "http://" + self.host + "/mh/api/v24/post/create.json", 95 | headers = header, 96 | data = json.dumps(payload) 97 | ) 98 | 99 | return r.json() 100 | 101 | def like(self, mid, postid, likeType=1001): 102 | 103 | header = { 104 | "Content-Type" : "application/json", 105 | "X-Line-Mid" : self.mid, 106 | "x-lct" : self.channel_access_token, 107 | } 108 | 109 | payload = { 110 | "likeType" : likeType, 111 | "activityExternalId" : postid, 112 | "actorId" : mid 113 | } 114 | 115 | r = requests.post( 116 | "http://" + self.host + "/mh/api/v23/like/create.json?homeId=" + mid, 117 | headers = header, 118 | data = json.dumps(payload) 119 | ) 120 | 121 | return r.json() 122 | 123 | def comment(self, mid, postid, text): 124 | header = { 125 | "Content-Type" : "application/json", 126 | "X-Line-Mid" : self.mid, 127 | "x-lct" : self.channel_access_token, 128 | } 129 | 130 | payload = { 131 | "commentText" : text, 132 | "activityExternalId" : postid, 133 | "actorId" : mid 134 | } 135 | 136 | r = requests.post( 137 | "http://" + self.host + "/mh/api/v23/comment/create.json?homeId=" + mid, 138 | headers = header, 139 | data = json.dumps(payload) 140 | ) 141 | 142 | return r.json() 143 | 144 | def activity(self, limit=20): 145 | 146 | header = { 147 | "Content-Type" : "application/json", 148 | "X-Line-Mid" : self.mid, 149 | "x-lct" : self.channel_access_token, 150 | } 151 | 152 | r = requests.get( 153 | "http://" + self.host + "/tl/mapi/v21/activities?postLimit=" + str(limit), 154 | headers = header 155 | ) 156 | return r.json() 157 | def getAlbum(self, gid): 158 | 159 | header = { 160 | "Content-Type" : "application/json", 161 | "X-Line-Mid" : self.mid, 162 | "x-lct": self.channel_access_token, 163 | 164 | } 165 | 166 | r = requests.get( 167 | "http://" + self.host + "/mh/album/v3/albums?type=g&sourceType=TALKROOM&homeId=" + gid, 168 | headers = header 169 | ) 170 | return r.json() 171 | def changeAlbumName(self,gid,name,albumId): 172 | header = { 173 | "Content-Type" : "application/json", 174 | "X-Line-Mid" : self.mid, 175 | "x-lct": self.channel_access_token, 176 | 177 | } 178 | payload = { 179 | "title": name 180 | } 181 | r = requests.put( 182 | "http://" + self.host + "/mh/album/v3/album/" + albumId + "?homeId=" + gid, 183 | headers = header, 184 | data = json.dumps(payload), 185 | ) 186 | return r.json() 187 | def deleteAlbum(self,gid,albumId): 188 | header = { 189 | "Content-Type" : "application/json", 190 | "X-Line-Mid" : self.mid, 191 | "x-lct": self.channel_access_token, 192 | 193 | } 194 | r = requests.delete( 195 | "http://" + self.host + "/mh/album/v3/album/" + albumId + "?homeId=" + gid, 196 | headers = header, 197 | ) 198 | return r.json() 199 | def getNote(self,gid, commentLimit, likeLimit): 200 | header = { 201 | "Content-Type" : "application/json", 202 | "X-Line-Mid" : self.mid, 203 | "x-lct": self.channel_access_token, 204 | 205 | } 206 | r = requests.get( 207 | "http://" + self.host + "/mh/api/v27/post/list.json?homeId=" + gid + "&commentLimit=" + commentLimit + "&sourceType=TALKROOM&likeLimit=" + likeLimit, 208 | headers = header 209 | ) 210 | return r.json() 211 | 212 | def postNote(self, gid, text): 213 | header = { 214 | "Content-Type": "application/json", 215 | "User-Agent" : self.UA, 216 | "X-Line-Mid" : self.mid, 217 | "x-lct" : self.channel_access_token, 218 | } 219 | payload = {"postInfo":{"readPermission":{"homeId":gid}}, 220 | "sourceType":"GROUPHOME", 221 | "contents":{"text":text} 222 | } 223 | r = requests.post( 224 | "http://" + self.host + "/mh/api/v27/post/create.json", 225 | headers = header, 226 | data = json.dumps(payload) 227 | ) 228 | return r.json() 229 | 230 | def getDetail(self, mid): 231 | header = { 232 | "Content-Type": "application/json", 233 | "User-Agent" : self.UA, 234 | "X-Line-Mid" : self.mid, 235 | "x-lct" : self.channel_access_token, 236 | } 237 | 238 | r = requests.get( 239 | "http://" + self.host + "/ma/api/v1/userpopup/getDetail.json?userMid=" + mid, 240 | headers = header 241 | ) 242 | return r.json() 243 | 244 | def getHome(self,mid): 245 | header = { 246 | "Content-Type": "application/json", 247 | "User-Agent" : self.UA, 248 | "X-Line-Mid" : self.mid, 249 | "x-lct" : self.channel_access_token, 250 | } 251 | 252 | r = requests.get( 253 | "http://" + self.host + "/mh/api/v27/post/list.json?homeId=" + mid + "&commentLimit=2&sourceType=LINE_PROFILE_COVER&likeLimit=6", 254 | headers = header 255 | ) 256 | return r.json() 257 | def getCover(self,mid): 258 | h = self.getHome(mid) 259 | objId = h["result"]["homeInfo"]["objectId"] 260 | return "http://dl.profile.line-cdn.net/myhome/c/download.nhn?userid=" + mid + "&oid=" + objId 261 | def createAlbum(self,gid,name): 262 | header = { 263 | "Content-Type": "application/json", 264 | "User-Agent" : self.UA, 265 | "X-Line-Mid" : self.mid, 266 | "x-lct" : self.channel_access_token, 267 | } 268 | payload = { 269 | "type" : "image", 270 | "title" : name 271 | } 272 | r = requests.post( 273 | "http://" + self.host + "/mh/album/v3/album?count=1&auto=0&homeId=" + gid, 274 | headers = header, 275 | data = json.dumps(payload) 276 | ) 277 | return r.json() 278 | 279 | def createAlbum2(self,gid,name,path,oid): 280 | header = { 281 | "Content-Type": "application/json", 282 | "User-Agent" : self.UA, 283 | "X-Line-Mid" : self.mid, 284 | "x-lct" : self.channel_access_token, 285 | } 286 | payload = { 287 | "type" : "image", 288 | "title" : name 289 | } 290 | r = requests.post( 291 | "http://" + self.host + "/mh/album/v3/album?count=1&auto=0&homeId=" + gid, 292 | headers = header, 293 | data = json.dumps(payload) 294 | ) 295 | #albumId = r.json()["result"]["items"][0]["id"] 296 | 297 | 298 | #h = { 299 | # "Content-Type": "application/x-www-form-urlencoded", 300 | # "User-Agent" : self.UA, 301 | # "X-Line-Mid" : gid, 302 | # "X-Line-Album" : albumId, 303 | # "x-lct" : self.channel_access_token, 304 | #"x-obs-host" : "obs-jp.line-apps.com:443", 305 | 306 | #} 307 | #print r.json() 308 | #files = { 309 | # 'file': open(path, 'rb'), 310 | #} 311 | #p = { 312 | # "userid" : gid, 313 | # "type" : "image", 314 | # "oid" : oid, 315 | # "ver" : "1.0" 316 | #} 317 | #data = { 318 | # 'params': json.dumps(p) 319 | #} 320 | #r = requests.post( 321 | #"http://obs-jp.line-apps.com/oa/album/a/object_info.nhn:443", 322 | #headers = h, 323 | #data = data, 324 | #files = files 325 | #) 326 | return r.json() 327 | #cl.createAlbum("cea9d61ba824e937aaf91637991ac934b","ss3ai","kawamuki.png") 328 | -------------------------------------------------------------------------------- /LINETCR/LineApi.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from Api import Poll, Talk, channel 3 | from lib.curve.ttypes import * 4 | 5 | def def_callback(str): 6 | print(str) 7 | 8 | class LINE: 9 | 10 | mid = None 11 | authToken = None 12 | cert = None 13 | channel_access_token = None 14 | token = None 15 | obs_token = None 16 | refresh_token = None 17 | 18 | 19 | def __init__(self): 20 | self.Talk = Talk() 21 | 22 | def login(self, mail=None, passwd=None, cert=None, token=None, qr=False, callback=None): 23 | if callback is None: 24 | callback = def_callback 25 | resp = self.__validate(mail,passwd,cert,token,qr) 26 | if resp == 1: 27 | self.Talk.login(mail, passwd, callback=callback) 28 | elif resp == 2: 29 | self.Talk.login(mail,passwd,cert, callback=callback) 30 | elif resp == 3: 31 | self.Talk.TokenLogin(token) 32 | elif resp == 4: 33 | self.Talk.qrLogin(callback) 34 | else: 35 | raise Exception("invalid arguments") 36 | 37 | self.authToken = self.Talk.authToken 38 | self.cert = self.Talk.cert 39 | 40 | self.Poll = Poll(self.authToken) 41 | self.channel = channel.Channel(self.authToken) 42 | self.channel.login() 43 | 44 | self.mid = self.channel.mid 45 | self.channel_access_token = self.channel.channel_access_token 46 | self.token = self.channel.token 47 | self.obs_token = self.channel.obs_token 48 | self.refresh_token = self.channel.refresh_token 49 | 50 | 51 | """User""" 52 | 53 | def getProfile(self): 54 | return self.Talk.client.getProfile() 55 | 56 | def getSettings(self): 57 | return self.Talk.client.getSettings() 58 | 59 | def getUserTicket(self): 60 | return self.Talk.client.getUserTicket() 61 | 62 | def updateProfile(self, profileObject): 63 | return self.Talk.client.updateProfile(0, profileObject) 64 | 65 | def updateSettings(self, settingObject): 66 | return self.Talk.client.updateSettings(0, settingObject) 67 | 68 | 69 | """Operation""" 70 | 71 | def fetchOperation(self, revision, count): 72 | return self.Poll.client.fetchOperations(revision, count) 73 | 74 | def fetchOps(self, rev, count): 75 | return self.Poll.client.fetchOps(rev, count, 0, 0) 76 | 77 | def getLastOpRevision(self): 78 | return self.Talk.client.getLastOpRevision() 79 | 80 | def stream(self): 81 | return self.Poll.stream() 82 | 83 | """Message""" 84 | 85 | def sendMessage(self, messageObject): 86 | return self.Talk.client.sendMessage(0,messageObject) 87 | 88 | def sendText(self, Tomid, text): 89 | msg = Message() 90 | msg.to = Tomid 91 | msg.text = text 92 | 93 | return self.Talk.client.sendMessage(0, msg) 94 | def sendImage(self, to_, path): 95 | M = Message(to=to_,contentType = 1) 96 | M.contentMetadata = None 97 | M.contentPreview = None 98 | M_id = self._client.sendMessage(M).id 99 | files = { 100 | 'file': open(path, 'rb'), 101 | } 102 | params = { 103 | 'name': 'media', 104 | 'oid': M_id, 105 | 'size': len(open(path, 'rb').read()), 106 | 'type': 'image', 107 | 'ver': '1.0', 108 | } 109 | data = { 110 | 'params': json.dumps(params) 111 | } 112 | r = self._client.post_content('https://os.line.naver.jp/talk/m/upload.nhn', data=data, files=files) 113 | if r.status_code != 201: 114 | raise Exception('Upload image failure.') 115 | #r.content 116 | return True 117 | def sendEvent(self, messageObject): 118 | return self._client.sendEvent(0, messageObject) 119 | 120 | def sendChatChecked(self, mid, lastMessageId): 121 | return self.Talk.client.sendChatChecked(0, mid, lastMessageId) 122 | 123 | def getMessageBoxCompactWrapUp(self, mid): 124 | return self.Talk.client.getMessageBoxCompactWrapUp(mid) 125 | 126 | def getMessageBoxCompactWrapUpList(self, start, messageBox): 127 | return self.Talk.client.getMessageBoxCompactWrapUpList(start, messageBox) 128 | 129 | def getRecentMessages(self, messageBox, count): 130 | return self.Talk.client.getRecentMessages(messageBox.id, count) 131 | 132 | def getMessageBox(self, channelId, messageboxId, lastMessagesCount): 133 | return self.Talk.client.getMessageBox(channelId, messageboxId, lastMessagesCount) 134 | 135 | def getMessageBoxList(self, channelId, lastMessagesCount): 136 | return self.Talk.client.getMessageBoxList(channelId, lastMessagesCount) 137 | 138 | def getMessageBoxListByStatus(self, channelId, lastMessagesCount, status): 139 | return self.Talk.client.getMessageBoxListByStatus(channelId, lastMessagesCount, status) 140 | 141 | def getMessageBoxWrapUp(self, mid): 142 | return self.Talk.client.getMessageBoxWrapUp(mid) 143 | 144 | def getMessageBoxWrapUpList(self, start, messageBoxCount): 145 | return self.Talk.client.getMessageBoxWrapUpList(start, messageBoxCount) 146 | 147 | """Contact""" 148 | 149 | 150 | def blockContact(self, mid): 151 | return self.Talk.client.blockContact(0, mid) 152 | 153 | 154 | def unblockContact(self, mid): 155 | return self.Talk.client.unblockContact(0, mid) 156 | 157 | 158 | def findAndAddContactsByMid(self, mid): 159 | return self.Talk.client.findAndAddContactsByMid(0, mid) 160 | 161 | 162 | def findAndAddContactsByMids(self, midlist): 163 | for i in midlist: 164 | self.Talk.client.findAndAddContactsByMid(0, i) 165 | 166 | def findAndAddContactsByUserid(self, userid): 167 | return self.Talk.client.findAndAddContactsByUserid(0, userid) 168 | 169 | def findContactsByUserid(self, userid): 170 | return self.Talk.client.findContactByUserid(userid) 171 | 172 | def findContactByTicket(self, ticketId): 173 | return self.Talk.client.findContactByUserTicket(ticketId) 174 | 175 | def getAllContactIds(self): 176 | return self.Talk.client.getAllContactIds() 177 | 178 | def getBlockedContactIds(self): 179 | return self.Talk.client.getBlockedContactIds() 180 | 181 | def getContact(self, mid): 182 | return self.Talk.client.getContact(mid) 183 | 184 | def getContacts(self, midlist): 185 | return self.Talk.client.getContacts(midlist) 186 | 187 | def getFavoriteMids(self): 188 | return self.Talk.client.getFavoriteMids() 189 | 190 | def getHiddenContactMids(self): 191 | return self.Talk.client.getHiddenContactMids() 192 | 193 | 194 | """Group""" 195 | 196 | def findGroupByTicket(self, ticketId): 197 | return self.Talk.client.findGroupByTicket(ticketId) 198 | 199 | def acceptGroupInvitation(self, groupId): 200 | return self.Talk.client.acceptGroupInvitation(0, groupId) 201 | 202 | def acceptGroupInvitationByTicket(self, groupId, ticketId): 203 | return self.Talk.client.acceptGroupInvitationByTicket(0, groupId, ticketId) 204 | 205 | def cancelGroupInvitation(self, groupId, contactIds): 206 | return self.Talk.client.cancelGroupInvitation(0, groupId, contactIds) 207 | 208 | def createGroup(self, name, midlist): 209 | return self.Talk.client.createGroup(0, name, midlist) 210 | 211 | def getGroup(self, groupId): 212 | return self.Talk.client.getGroup(groupId) 213 | 214 | def getGroups(self, groupIds): 215 | return self.Talk.client.getGroups(groupIds) 216 | 217 | def getGroupIdsInvited(self): 218 | return self.Talk.client.getGroupIdsInvited() 219 | 220 | def getGroupIdsJoined(self): 221 | return self.Talk.client.getGroupIdsJoined() 222 | 223 | def inviteIntoGroup(self, groupId, midlist): 224 | return self.Talk.client.inviteIntoGroup(0, groupId, midlist) 225 | 226 | def kickoutFromGroup(self, groupId, midlist): 227 | return self.Talk.client.kickoutFromGroup(0, groupId, midlist) 228 | 229 | def leaveGroup(self, groupId): 230 | return self.Talk.client.leaveGroup(0, groupId) 231 | 232 | def rejectGroupInvitation(self, groupId): 233 | return self.Talk.client.rejectGroupInvitation(0, groupId) 234 | 235 | def reissueGroupTicket(self, groupId): 236 | return self.Talk.client.reissueGroupTicket(groupId) 237 | 238 | def updateGroup(self, groupObject): 239 | return self.Talk.client.updateGroup(0, groupObject) 240 | def findGroupByTicket(self,ticketId): 241 | return self.Talk.client.findGroupByTicket(0,ticketId) 242 | 243 | """Room""" 244 | 245 | def createRoom(self, midlist): 246 | return self.Talk.client.createRoom(0, midlist) 247 | 248 | def getRoom(self, roomId): 249 | return self.Talk.client.getRoom(roomId) 250 | 251 | def inviteIntoRoom(self, roomId, midlist): 252 | return self.Talk.client.inviteIntoRoom(0, roomId, midlist) 253 | 254 | def leaveRoom(self, roomId): 255 | return self.Talk.client.leaveRoom(0, roomId) 256 | 257 | """TIMELINE""" 258 | 259 | def new_post(self, text): 260 | return self.channel.new_post(text) 261 | 262 | def like(self, mid, postid, likeType=1001): 263 | return self.channel.like(mid, postid, likeType) 264 | 265 | def comment(self, mid, postid, text): 266 | return self.channel.comment(mid, postid, text) 267 | 268 | def activity(self, limit=20): 269 | return self.channel.activity(limit) 270 | 271 | def getAlbum(self, gid): 272 | 273 | return self.channel.getAlbum(gid) 274 | def changeAlbumName(self, gid, name, albumId): 275 | return self.channel.changeAlbumName(gid, name, albumId) 276 | 277 | def deleteAlbum(self, gid, albumId): 278 | return self.channel.deleteAlbum(gid,albumId) 279 | 280 | def getNote(self,gid, commentLimit, likeLimit): 281 | return self.channel.getNote(gid, commentLimit, likeLimit) 282 | 283 | def getDetail(self,mid): 284 | return self.channel.getDetail(mid) 285 | 286 | def getHome(self,mid): 287 | return self.channel.getHome(mid) 288 | 289 | def createAlbum(self, gid, name): 290 | return self.channel.createAlbum(gid,name) 291 | 292 | def createAlbum2(self, gid, name, path): 293 | return self.channel.createAlbum(gid, name, path, oid) 294 | 295 | 296 | def __validate(self, mail, passwd, cert, token, qr): 297 | if mail is not None and passwd is not None and cert is None: 298 | return 1 299 | elif mail is not None and passwd is not None and cert is not None: 300 | return 2 301 | elif token is not None: 302 | return 3 303 | elif qr is True: 304 | return 4 305 | else: 306 | return 5 307 | 308 | def loginResult(self, callback=None): 309 | if callback is None: 310 | callback = def_callback 311 | 312 | prof = self.getProfile() 313 | 314 | print("Ŧяәәƅoŧ") 315 | print("mid -> " + prof.mid) 316 | print("name -> " + prof.displayName) 317 | print("authToken -> " + self.authToken) 318 | print("cert -> " + self.cert if self.cert is not None else "") 319 | -------------------------------------------------------------------------------- /LINETCR/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from LineApi import LINE 3 | from lib.curve.ttypes import * 4 | -------------------------------------------------------------------------------- /LINETCR/lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Treerach/SelfBot/e32dbb37441d9f465ae76e901c4bd4b21ac26f16/LINETCR/lib/.DS_Store -------------------------------------------------------------------------------- /LINETCR/lib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- -------------------------------------------------------------------------------- /LINETCR/lib/curve/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ['ttypes', 'constants', 'LineService'] 2 | -------------------------------------------------------------------------------- /LINETCR/lib/curve/constants.py: -------------------------------------------------------------------------------- 1 | # 2 | # Autogenerated by Thrift Compiler (0.9.3) 3 | # 4 | # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 5 | # 6 | # options string: py 7 | # 8 | 9 | from thrift.Thrift import TType, TMessageType, TException, TApplicationException 10 | from ttypes import * 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SelfBot 2 | 3 | Run bot without pc or of Android : 4 | - Download Termux & Install 5 | - pkg install python2 6 | - pkg install git 7 | - git clone https://github.com/treerach/SelfBot 8 | - pip2 install thrift==0.9.3 9 | - pip2 install rsa 10 | - pip2 install requests 11 | - pkg install nano 12 | - cd SelfBot 13 | - python2 treebot.py 14 | - Done 15 | -------------------------------------------------------------------------------- /treebot.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import LINETCR 4 | from LINETCR.lib.curve.ttypes import * 5 | from datetime import datetime 6 | import time,random,sys,json,codecs,threading,glob,requests,urllib 7 | 8 | cl = LINETCR.LINE() 9 | cl.login(qr=True) 10 | cl.loginResult() 11 | ki = ki2 = ki3 = ki4 = ki5 = cl 12 | 13 | print u"login success" 14 | reload(sys) 15 | sys.setdefaultencoding('utf-8') 16 | 17 | helpMessage ="""Ŧяәәƅoŧ v2.7 18 | ~~~~~~~ Command ~~~~~~~ 19 | ¤ Tagall - Tagall Member Group 20 | ¤ Lurking - Set Point Read 21 | ¤ Result - Reading Point 22 | ¤ Ginfo - Info Grup 23 | 24 | ~~~~~~ Command Admin ~~~~~~ 25 | ¤ Glist - List Group BOT 26 | ¤ Cancel - Cancel All Pending Grup 27 | ¤ Mid @ - Get MID 28 | ¤ Invite - Invite Via Send Contact 29 | ¤ Invite: - Via MID 30 | ¤ Whitelist @ - Via Tag 31 | ¤ Whitelist: - Via Mid 32 | ¤ Whitelist - Via Send Contact 33 | ¤ Blacklist @ - Via Tag 34 | ¤ Blacklist: - Via Mid 35 | ¤ Blacklist - Via Send Contact 36 | ¤ Clear ban - Delete All Blacklist 37 | ¤ Link on - Open QR 38 | ¤ Link off - Close QR 39 | ¤ Gurl - Open QR And Get Link 40 | ¤ Url - Get QR Link 41 | ¤ Gname - Change Name Group 42 | ¤ Banlist - Cek Tersangka Kriminal 43 | ¤ Details grup - Via Gid 44 | ¤ Inviteme: - Via Gid 45 | ¤ Info grup 46 | ¤ Clear grup 47 | 48 | ~~~~~ Command for kicker ~~~~~ 49 | ¤ Nuke 50 | ¤ Ratakan 51 | ¤ Kick @ - Via Tag 52 | ¤ Kick: - Via MID 53 | 54 | ~~~~~~ Command Player ~~~~~~ 55 | ¤ Bc:ct 56 | ¤ Bc:grup 57 | ¤ Block @ 58 | ¤ Blocklist 59 | ¤ Spam on/off 60 | ¤ Uni 61 | ¤ Bot:ct - Contact BOT 62 | ¤ Bot:grup - Grup Joined BOT 63 | ¤ Allname: - Change All Name BOT 64 | ¤ Allbio: - Change All Bio BOT 65 | ¤ Bot sp - Tes Speed BOT 66 | ¤ Speed - Tes Speed 67 | ¤ Mycopy @ - Copy Profile 68 | ¤ Mybackup @ - Backup Profile 69 | 70 | ~~~~~~ Command Setting ~~~~~~ 71 | ¤ [Like:on/off] 72 | ¤ [Add on/off] 73 | ¤ [Auto join on/off] 74 | ¤ [Contact on/off] 75 | ¤ [Leave on/off] 76 | ¤ [Share on/off] 77 | ¤ [Add on/off] 78 | ¤ [Jam on/off] 79 | ¤ [Jam say:] 80 | ¤ [Com on/off] 81 | ¤ [Message set:] 82 | ¤ [Comment set:] 83 | ¤ [Message add:] 84 | 85 | ~~~~ Auto Setting Command ~~~~~ 86 | ¤ [Panick:on/off] 87 | ¤ [Protect on] 88 | ¤ [Qrprotect on/off] 89 | ¤ [Inviteprotect on/off] 90 | ¤ [Cancelprotect on/off] 91 | ¤ [Staff add/remove @] 92 | ~~~~~~~~ For Admin ~~~~~~~~ 93 | 94 | """ 95 | KAC=[cl,ki,ki2,ki3,ki4,ki5] 96 | mid = cl.getProfile().mid 97 | kimid = ki.getProfile().mid 98 | ki2mid = ki2.getProfile().mid 99 | ki3mid = ki3.getProfile().mid 100 | ki4mid = ki4.getProfile().mid 101 | ki5mid = ki5.getProfile().mid 102 | Bots = [mid,kimid,ki2mid,ki3mid,ki4mid,ki5mid,"u9489706a45fcf78bea076c6b77f7067d"] 103 | admsa = "u9489706a45fcf78bea076c6b77f7067d" 104 | admin = "u9489706a45fcf78bea076c6b77f7067d" 105 | 106 | wait = { 107 | 'contact':False, 108 | 'autoJoin':True, 109 | 'autoCancel':{"on":True,"members":20}, 110 | 'leaveRoom':True, 111 | 'timeline':False, 112 | 'autoAdd':True, 113 | 'message':" ", 114 | "lang":"JP", 115 | "comment":"Auto Like", 116 | "commentOn":False, 117 | "likeOn":False, 118 | "commentBlack":{}, 119 | "wblack":False, 120 | "dblack":False, 121 | "clock":False, 122 | "cNames":"", 123 | "blacklist":{}, 124 | "wblacklist":False, 125 | "dblacklist":False, 126 | "protect":True, 127 | "cancelprotect":False, 128 | "inviteprotect":False, 129 | "linkprotect":False, 130 | } 131 | 132 | wait2 = { 133 | 'readPoint':{}, 134 | 'readMember':{}, 135 | 'setTime':{}, 136 | "ricoinvite":{}, 137 | 'ROM':{}, 138 | } 139 | 140 | setTime = {} 141 | setTime = wait2['setTime'] 142 | blacklistFile='blacklist.txt' 143 | pendinglistFile='pendinglist.txt' 144 | 145 | contact = cl.getProfile() 146 | mybackup = cl.getProfile() 147 | mybackup.displayName = contact.displayName 148 | mybackup.statusMessage = contact.statusMessage 149 | mybackup.pictureStatus = contact.pictureStatus 150 | 151 | contact = ki.getProfile() 152 | backup = ki.getProfile() 153 | backup.displayName = contact.displayName 154 | backup.statusMessage = contact.statusMessage 155 | backup.pictureStatus = contact.pictureStatus 156 | 157 | def cms(string, commands): #/XXX, >XXX, ;XXX, ^XXX, %XXX, $XXX... 158 | tex = ["+","@","/",">",";","^","%","$","^","サテラ:","サテラ:","サテラ:","サテラ:"] 159 | for texX in tex: 160 | for command in commands: 161 | if string ==command: 162 | return True 163 | return False 164 | 165 | def bot(op): 166 | try: 167 | if op.type == 0: 168 | return 169 | if op.type == 13: 170 | if mid in op.param3: 171 | G = cl.getGroup(op.param1) 172 | if wait["autoJoin"] == True: 173 | if wait["autoCancel"]["on"] == True: 174 | if len(G.members) <= wait["autoCancel"]["members"]: 175 | cl.rejectGroupInvitation(op.param1) 176 | else: 177 | cl.acceptGroupInvitation(op.param1) 178 | else: 179 | cl.acceptGroupInvitation(op.param1) 180 | elif wait["autoCancel"]["on"] == True: 181 | if len(G.members) <= wait["autoCancel"]["members"]: 182 | cl.rejectGroupInvitation(op.param1) 183 | else: 184 | Inviter = op.param3.replace("",',') 185 | InviterX = Inviter.split(",") 186 | matched_list = [] 187 | for tag in wait["blacklist"]: 188 | matched_list+=filter(lambda str: str == tag, InviterX) 189 | if matched_list == []: 190 | pass 191 | else: 192 | cl.cancelGroupInvitation(op.param1, matched_list) 193 | if op.type == 19: 194 | if mid in op.param3: 195 | wait["blacklist"][op.param2] = True 196 | if op.type == 22: 197 | if wait["leaveRoom"] == True: 198 | cl.leaveRoom(op.param1) 199 | if op.type == 24: 200 | if wait["leaveRoom"] == True: 201 | cl.leaveRoom(op.param1) 202 | if op.type == 26: 203 | msg = op.message 204 | if msg.toType == 0: 205 | msg.to = msg.from_ 206 | if msg.from_ == "ucd886b532f581aa4de98af5898719392": 207 | if "join:" in msg.text: 208 | list_ = msg.text.split(":") 209 | try: 210 | cl.acceptGroupInvitationByTicket(list_[1],list_[2]) 211 | G = cl.getGroup(list_[1]) 212 | G.preventJoinByTicket = True 213 | cl.updateGroup(G) 214 | except: 215 | cl.sendText(msg.to,"error") 216 | if msg.toType == 1: 217 | if wait["leaveRoom"] == True: 218 | cl.leaveRoom(msg.to) 219 | if msg.contentType == 16: 220 | url = msg.contentMetadata["postEndUrl"] 221 | cl.like(url[25:58], url[66:], likeType=1001) 222 | if op.type == 25: 223 | msg = op.message 224 | if msg.contentType == 13: 225 | if wait["ricoinvite"] == True: 226 | if msg.from_ in admin: 227 | _name = msg.contentMetadata["displayName"] 228 | invite = msg.contentMetadata["mid"] 229 | groups = cl.getGroup(msg.to) 230 | pending = groups.invitee 231 | targets = [] 232 | for s in groups.members: 233 | if _name in s.displayName: 234 | ki.sendText(msg.to,"-> " + _name + " was here") 235 | break 236 | elif invite in wait["blacklist"]: 237 | cl.sendText(msg.to,"Sorry, " + _name + " On Blacklist") 238 | cl.sendText(msg.to,"Call my daddy to use command !, \n➡Unban: " + invite) 239 | break 240 | else: 241 | targets.append(invite) 242 | if targets == []: 243 | pass 244 | else: 245 | for target in targets: 246 | try: 247 | ki.findAndAddContactsByMid(target) 248 | ki.inviteIntoGroup(msg.to,[target]) 249 | random.choice(KAC).sendText(msg.to,"Invited this nigga💋: \n➡" + _name) 250 | wait2["ricoinvite"] = False 251 | break 252 | except: 253 | cl.sendText(msg.to,"Negative, Err0r Detected") 254 | wait2["ricoinvite"] = False 255 | break 256 | if msg.contentType == 13: 257 | if wait["wblack"] == True: 258 | if msg.contentMetadata["mid"] in wait["commentBlack"]: 259 | cl.sendText(msg.to,"sudah masuk daftar hitam👈") 260 | wait["wblack"] = False 261 | else: 262 | wait["commentBlack"][msg.contentMetadata["mid"]] = True 263 | wait["wblack"] = False 264 | cl.sendText(msg.to,"Itu tidak berkomentar👈") 265 | elif wait["dblack"] == True: 266 | if msg.contentMetadata["mid"] in wait["commentBlack"]: 267 | del wait["commentBlack"][msg.contentMetadata["mid"]] 268 | cl.sendText(msg.to,"Done") 269 | wait["dblack"] = False 270 | else: 271 | wait["dblack"] = False 272 | cl.sendText(msg.to,"Tidak ada dalam daftar hitam👈") 273 | elif wait["wblacklist"] == True: 274 | if msg.contentMetadata["mid"] in wait["blacklist"]: 275 | cl.sendText(msg.to,"sudah masuk daftar hitam") 276 | wait["wblacklist"] = False 277 | else: 278 | wait["blacklist"][msg.contentMetadata["mid"]] = True 279 | wait["wblacklist"] = False 280 | cl.sendText(msg.to,"Done👈") 281 | elif wait["dblacklist"] == True: 282 | if msg.contentMetadata["mid"] in wait["blacklist"]: 283 | del wait["blacklist"][msg.contentMetadata["mid"]] 284 | cl.sendText(msg.to,"Done👈") 285 | wait["dblacklist"] = False 286 | else: 287 | wait["dblacklist"] = False 288 | cl.sendText(msg.to,"Done👈") 289 | elif wait["contact"] == True: 290 | msg.contentType = 0 291 | cl.sendText(msg.to,msg.contentMetadata["mid"]) 292 | if 'displayName' in msg.contentMetadata: 293 | contact = cl.getContact(msg.contentMetadata["mid"]) 294 | try: 295 | cu = cl.channel.getCover(msg.contentMetadata["mid"]) 296 | except: 297 | cu = "" 298 | cl.sendText(msg.to,"[displayName]:\n" + msg.contentMetadata["displayName"] + "\n[mid]:\n" + msg.contentMetadata["mid"] + "\n[statusMessage]:\n" + contact.statusMessage + "\n[pictureStatus]:\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n[coverURL]:\n" + str(cu)) 299 | else: 300 | contact = cl.getContact(msg.contentMetadata["mid"]) 301 | try: 302 | cu = cl.channel.getCover(msg.contentMetadata["mid"]) 303 | except: 304 | cu = "" 305 | cl.sendText(msg.to,"[displayName]:\n" + contact.displayName + "\n[mid]:\n" + msg.contentMetadata["mid"] + "\n[statusMessage]:\n" + contact.statusMessage + "\n[pictureStatus]:\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n[coverURL]:\n" + str(cu)) 306 | elif msg.contentType == 16: 307 | if wait["timeline"] == True: 308 | msg.contentType = 0 309 | if wait["lang"] == "JP": 310 | msg.text = "menempatkan URL\n" + msg.contentMetadata["postEndUrl"] 311 | else: 312 | msg.text = "URL→\n" + msg.contentMetadata["postEndUrl"] 313 | cl.sendText(msg.to,msg.text) 314 | elif msg.text is None: 315 | return 316 | elif msg.text.lower() == 'help': 317 | if wait["lang"] == "JP": 318 | cl.sendText(msg.to,helpMessage) 319 | else: 320 | cl.sendText(msg.to,helpMessage) 321 | elif "Mybot" == msg.text: 322 | msg.contentType = 13 323 | msg.contentMetadata = {'mid': kimid} 324 | ki.sendMessage(msg) 325 | msg.contentType = 13 326 | msg.contentMetadata = {'mid': ki2mid} 327 | ki2.sendMessage(msg) 328 | msg.contentType = 13 329 | msg.contentMetadata = {'mid': ki3mid} 330 | ki3.sendMessage(msg) 331 | msg.contentType = 13 332 | msg.contentMetadata = {'mid': ki4mid} 333 | ki4.sendMessage(msg) 334 | msg.contentType = 13 335 | msg.contentMetadata = {'mid': ki5mid} 336 | ki5.sendMessage(msg) 337 | msg.contentType = 13 338 | 339 | elif "Pro1" == msg.text: 340 | msg.contentType = 13 341 | msg.contentMetadata = {'mid': kimid} 342 | ki.sendMessage(msg) 343 | elif "Pro2" == msg.text: 344 | msg.contentType = 13 345 | msg.contentMetadata = {'mid': ki2mid} 346 | ki2.sendMessage(msg) 347 | elif "Pro3" == msg.text: 348 | msg.contentType = 13 349 | msg.contentMetadata = {'mid': ki3mid} 350 | ki3.sendMessage(msg) 351 | elif "Pro4" == msg.text: 352 | msg.contentType = 13 353 | msg.contentMetadata = {'mid': ki4mid} 354 | ki4.sendMessage(msg) 355 | elif "Pro5" == msg.text: 356 | msg.contentType = 13 357 | msg.contentMetadata = {'mid': ki5mid} 358 | ki5.sendMessage(msg) 359 | 360 | elif msg.text in ["Bot1 Gift","Bot1 gift"]: 361 | msg.contentType = 9 362 | msg.contentMetadata={'PRDID': '3b92ccf5-54d3-4765-848f-c9ffdc1da020', 363 | 'PRDTYPE': 'THEME', 364 | 'MSGTPL': '2'} 365 | msg.text = None 366 | ki.sendMessage(msg) 367 | elif msg.text in ["Gift","gift"]: 368 | msg.contentType = 9 369 | msg.contentMetadata={'PRDID': '3b92ccf5-54d3-4765-848f-c9ffdc1da020', 370 | 'PRDTYPE': 'THEME', 371 | 'MSGTPL': '3'} 372 | msg.text = None 373 | cl.sendMessage(msg) 374 | 375 | elif msg.text in ["Bot2 Gift","Bot2 gift"]: 376 | msg.contentType = 9 377 | msg.contentMetadata={'PRDID': '3b92ccf5-54d3-4765-848f-c9ffdc1da020', 378 | 'PRDTYPE': 'THEME', 379 | 'MSGTPL': '3'} 380 | msg.text = None 381 | ki2.sendMessage(msg) 382 | 383 | elif msg.text in ["Bot3 Gift","Bot3 gift"]: 384 | msg.contentType = 9 385 | msg.contentMetadata={'PRDID': '3b92ccf5-54d3-4765-848f-c9ffdc1da020', 386 | 'PRDTYPE': 'THEME', 387 | 'MSGTPL': '4'} 388 | msg.text = None 389 | ki3.sendMessage(msg) 390 | elif msg.text in ["Bot4 Gift","Bot4 gift"]: 391 | msg.contentType = 9 392 | msg.contentMetadata={'PRDID': '3b92ccf5-54d3-4765-848f-c9ffdc1da020', 393 | 'PRDTYPE': 'THEME', 394 | 'MSGTPL': '5'} 395 | msg.text = None 396 | ki4.sendMessage(msg) 397 | 398 | elif msg.text in ["Cancel","cancel"]: 399 | if msg.from_ in admin: 400 | if msg.toType == 2: 401 | group = cl.getGroup(msg.to) 402 | if group.invitee is not None: 403 | gInviMids = [contact.mid for contact in group.invitee] 404 | cl.cancelGroupInvitation(msg.to, gInviMids) 405 | else: 406 | if wait["lang"] == "JP": 407 | cl.sendText(msg.to,"No invites👈") 408 | else: 409 | cl.sendText(msg.to,"Invite people inside not👈") 410 | else: 411 | if wait["lang"] == "JP": 412 | cl.sendText(msg.to,"Tidak ada undangan👈") 413 | else: 414 | cl.sendText(msg.to,"invitan tidak ada") 415 | elif "Contact" == msg.text: 416 | msg.contentType = 13 417 | msg.contentMetadata = {'mid': msg.to} 418 | cl.sendMessage(msg) 419 | elif "Pro1 mid" == msg.text: 420 | ki.sendText(msg.to,kimid) 421 | elif "Pro2 mid" == msg.text: 422 | ki2.sendText(msg.to,ki2mid) 423 | elif "Pro3 mid" == msg.text: 424 | ki3.sendText(msg.to,ki3mid) 425 | elif "Pro4 mid" == msg.text: 426 | ki4.sendText(msg.to,ki4mid) 427 | elif "Pro5 mid" == msg.text: 428 | ki5.sendText(msg.to,ki5mid) 429 | 430 | elif "All mid" == msg.text: 431 | ki.sendText(msg.to,kimid) 432 | ki2.sendText(msg.to,ki2mid) 433 | ki3.sendText(msg.to,ki3mid) 434 | ki4.sendText(msg.to,ki4mid) 435 | ki5.sendText(msg.to,ki5mid) 436 | 437 | elif "Timeline: " in msg.text: 438 | tl_text = msg.text.replace("Timeline: ","") 439 | cl.sendText(msg.to,"line://home/post?userMid="+mid+"&postId="+cl.new_post(tl_text)["result"]["post"]["postInfo"]["postId"]) 440 | elif "Allname: " in msg.text: 441 | string = msg.text.replace("Allname: ","") 442 | if len(string.decode('utf-8')) <= 20: 443 | profile = ki.getProfile() 444 | profile.displayName = string 445 | ki.updateProfile(profile) 446 | if len(string.decode('utf-8')) <= 20: 447 | profile = ki2.getProfile() 448 | profile.displayName = string 449 | ki2.updateProfile(profile) 450 | if len(string.decode('utf-8')) <= 20: 451 | profile = ki3.getProfile() 452 | profile.displayName = string 453 | ki3.updateProfile(profile) 454 | if len(string.decode('utf-8')) <= 20: 455 | profile = ki4.getProfile() 456 | profile.displayName = string 457 | ki4.updateProfile(profile) 458 | if len(string.decode('utf-8')) <= 20: 459 | profile = ki5.getProfile() 460 | profile.displayName = string 461 | ki5.updateProfile(profile) 462 | 463 | elif "Allbio: " in msg.text: 464 | string = msg.text.replace("Allbio: ","") 465 | if len(string.decode('utf-8')) <= 500: 466 | profile = ki.getProfile() 467 | profile.statusMessage = string 468 | ki.updateProfile(profile) 469 | if len(string.decode('utf-8')) <= 500: 470 | profile = ki2.getProfile() 471 | profile.statusMessage = string 472 | ki2.updateProfile(profile) 473 | if len(string.decode('utf-8')) <= 500: 474 | profile = ki3.getProfile() 475 | profile.statusMessage = string 476 | ki3.updateProfile(profile) 477 | if len(string.decode('utf-8')) <= 500: 478 | profile = ki4.getProfile() 479 | profile.statusMessage = string 480 | ki4.updateProfile(profile) 481 | if len(string.decode('utf-8')) <= 500: 482 | profile = ki5.getProfile() 483 | profile.statusMessage = string 484 | ki5.updateProfile(profile) 485 | 486 | #--------------------------------------------------------- 487 | elif "1pro: " in msg.text: 488 | string = msg.text.replace("1pro: ","") 489 | if len(string.decode('utf-8')) <= 20: 490 | profile = ki.getProfile() 491 | profile.displayName = string 492 | ki.updateProfile(profile) 493 | ki.sendText(msg.to,"􀜁􀇔􏿿Update Names👉" + string + "👈") 494 | #-------------------------------------------------------- 495 | elif "2pro: " in msg.text: 496 | string = msg.text.replace("2pro: ","") 497 | if len(string.decode('utf-8')) <= 20: 498 | profile = ki2.getProfile() 499 | profile.displayName = string 500 | ki2.updateProfile(profile) 501 | ki2.sendText(msg.to,"􀜁􀇔􏿿Update Names👉" + string + "👈") 502 | #-------------------------------------------------------- 503 | elif "3pro: " in msg.text: 504 | string = msg.text.replace("3pro: ","") 505 | if len(string.decode('utf-8')) <= 20: 506 | profile = ki3.getProfile() 507 | profile.displayName = string 508 | ki3.updateProfile(profile) 509 | ki3.sendText(msg.to,"􀜁􀇔􏿿Update Names👉" + string + "👈") 510 | #-------------------------------------------------------- 511 | elif "4pro: " in msg.text: 512 | string = msg.text.replace("4pro: ","") 513 | if len(string.decode('utf-8')) <= 20: 514 | profile = ki4.getProfile() 515 | profile.displayName = string 516 | ki4.updateProfile(profile) 517 | ki4.sendText(msg.to,"􀜁􀇔􏿿Update Names👉" + string + "👈") 518 | #-------------------------------------------------------- 519 | elif "5pro: " in msg.text: 520 | string = msg.text.replace("5pro: ","") 521 | if len(string.decode('utf-8')) <= 20: 522 | profile = ki5.getProfile() 523 | profile.displayName = string 524 | ki5.updateProfile(profile) 525 | ki5.sendText(msg.to,"􀜁􀇔􏿿Update Names👉" + string + "👈") 526 | #-------------------------------------------------------- 527 | elif "Mid: " in msg.text: 528 | mmid = msg.text.replace("Mid: ","") 529 | msg.contentType = 13 530 | msg.contentMetadata = {"mid":mmid} 531 | cl.sendMessage(msg) 532 | elif msg.text.lower() == 'contact on': 533 | if wait["contact"] == True: 534 | if wait["lang"] == "JP": 535 | cl.sendText(msg.to,"Sudah On") 536 | else: 537 | cl.sendText(msg.to,"It is already open") 538 | else: 539 | wait["contact"] = True 540 | if wait["lang"] == "JP": 541 | cl.sendText(msg.to,"already open 👈") 542 | else: 543 | cl.sendText(msg.to,"It is already open 􀜁􀇔􏿿") 544 | elif msg.text.lower() == 'contact off': 545 | if wait["contact"] == False: 546 | if wait["lang"] == "JP": 547 | cl.sendText(msg.to,"sudah off ô€œô€„‰👈") 548 | else: 549 | cl.sendText(msg.to,"It is already off ô€œ��ô€„‰👈") 550 | else: 551 | wait["contact"] = False 552 | if wait["lang"] == "JP": 553 | cl.sendText(msg.to,"off ô€œô€„‰already") 554 | else: 555 | cl.sendText(msg.to,"already Close ô€œô€„‰👈") 556 | elif msg.text.lower() == 'protect on': 557 | if wait["protect"] == True: 558 | if wait["lang"] == "JP": 559 | cl.sendText(msg.to,"It's already on 􀜁􀇔􏿿👈") 560 | else: 561 | cl.sendText(msg.to,"It is already open ô€¨👈") 562 | else: 563 | wait["protect"] = True 564 | if wait["lang"] == "JP": 565 | cl.sendText(msg.to,"already ON􀜁􀇔􏿿") 566 | else: 567 | cl.sendText(msg.to,"It is already On ô€¨") 568 | elif msg.text.lower() == 'qrprotect on': 569 | if wait["linkprotect"] == True: 570 | if wait["lang"] == "JP": 571 | cl.sendText(msg.to,"It's already on 􀜁􀇔��👈") 572 | else: 573 | cl.sendText(msg.to,"It is already open ô€¨👈") 574 | else: 575 | wait["linkprotect"] = True 576 | if wait["lang"] == "JP": 577 | cl.sendText(msg.to,"already ON􀜁􀇔􏿿") 578 | else: 579 | cl.sendText(msg.to,"It is already On ô€¨") 580 | elif msg.text.lower() == 'inviteprotect on': 581 | if wait["inviteprotect"] == True: 582 | if wait["lang"] == "JP": 583 | cl.sendText(msg.to,"It's already on 􀜁􀇔􏿿👈") 584 | else: 585 | cl.sendText(msg.to,"It is already open ô€¨����👈") 586 | else: 587 | wait["inviteprotect"] = True 588 | if wait["lang"] == "JP": 589 | cl.sendText(msg.to,"already ON􀜁􀇔􏿿") 590 | else: 591 | cl.sendText(msg.to,"It is already On ô€¨") 592 | elif msg.text.lower() == 'cancelprotect on': 593 | if wait["cancelprotect"] == True: 594 | if wait["lang"] == "JP": 595 | cl.sendText(msg.to,"It's already on 􀜁􀇔􏿿👈") 596 | else: 597 | cl.sendText(msg.to,"It is already open ô€¨👈") 598 | else: 599 | wait["cancelprotect"] = True 600 | if wait["lang"] == "JP": 601 | cl.sendText(msg.to,"already ON􀜁􀇔􏿿") 602 | else: 603 | cl.sendText(msg.to,"It is already On ô€¨") 604 | elif msg.text.lower() == 'auto join on': 605 | if wait["autoJoin"] == True: 606 | if wait["lang"] == "JP": 607 | cl.sendText(msg.to,"It's already off 􀜁􀇔􏿿👈") 608 | else: 609 | cl.sendText(msg.to,"It is already open ô€¨👈") 610 | else: 611 | wait["autoJoin"] = True 612 | if wait["lang"] == "JP": 613 | cl.sendText(msg.to,"already ON􀜁􀇔􏿿") 614 | else: 615 | cl.sendText(msg.to,"It is already On ô€¨") 616 | elif msg.text in ["Allprotect on","Panick:on"]: 617 | if msg.from_ in admin: 618 | if wait["inviteprotect"] == True: 619 | if wait["lang"] == "JP": 620 | cl.sendText(msg.to,"It's already on 􀜁􀇔􏿿👈") 621 | else: 622 | cl.sendText(msg.to,"Already on") 623 | else: 624 | wait["inviteprotect"] = True 625 | if wait["lang"] == "JP": 626 | cl.sendText(msg.to,"Protect invite on 􀜁􀇔􏿿") 627 | if wait["cancelprotect"] == True: 628 | if wait["lang"] == "JP": 629 | cl.sendText(msg.to,"It's already on 􀜁􀇔􏿿👈") 630 | else: 631 | cl.sendText(msg.to,"Already on") 632 | else: 633 | wait["cancelprotect"] = True 634 | if wait["lang"] == "JP": 635 | cl.sendText(msg.to,"Protect cancel on 􀜁􀇔􏿿") 636 | if wait["protect"] == True: 637 | if wait["lang"] == "JP": 638 | cl.sendText(msg.to,"It's already on 􀜁􀇔􏿿👈") 639 | else: 640 | cl.sendText(msg.to,"Already on") 641 | else: 642 | wait["protect"] = True 643 | if wait["lang"] == "JP": 644 | cl.sendText(msg.to,"Protect on 􀜁􀇔􏿿") 645 | else: 646 | cl.sendText(msg.to,"Already on") 647 | if wait["linkprotect"] == True: 648 | if wait["lang"] == "JP": 649 | cl.sendText(msg.to,"It's already on 􀜁􀇔􏿿👈") 650 | else: 651 | cl.sendText(msg.to,"Already on") 652 | else: 653 | wait["linkprotect"] = True 654 | if wait["lang"] == "JP": 655 | cl.sendText(msg.to,"Protect QR on 􀜁􀇔􏿿") 656 | else: 657 | cl.sendText(msg.to,"Already on") 658 | elif msg.text in ["Allprotect off","Panick:off"]: 659 | if msg.from_ in admin: 660 | if wait["inviteprotect"] == False: 661 | if wait["lang"] == "JP": 662 | cl.sendText(msg.to,"It's already off 􀜁􀇔􏿿👈") 663 | else: 664 | cl.sendText(msg.to,"Already off") 665 | else: 666 | wait["inviteprotect"] = False 667 | if wait["lang"] == "JP": 668 | cl.sendText(msg.to,"Protect invite off 􀜁􀇔􏿿") 669 | if wait["cancelprotect"] == False: 670 | if wait["lang"] == "JP": 671 | cl.sendText(msg.to,"Ini sudah off 􀜁􀇔􏿿👈") 672 | else: 673 | cl.sendText(msg.to,"Already off") 674 | else: 675 | wait["cancelprotect"] = False 676 | if wait["lang"] == "JP": 677 | cl.sendText(msg.to,"Protect cancel off 􀜁􀇔􏿿") 678 | if wait["protect"] == False: 679 | if wait["lang"] == "JP": 680 | cl.sendText(msg.to,"It's already off􀜁􀇔􏿿👈") 681 | else: 682 | cl.sendText(msg.to,"Already off") 683 | else: 684 | wait["protect"] = False 685 | if wait["lang"] == "JP": 686 | cl.sendText(msg.to,"Protect off 􀜁􀇔􏿿") 687 | else: 688 | cl.sendText(msg.to,"Already off") 689 | if wait["linkprotect"] == False: 690 | if wait["lang"] == "JP": 691 | cl.sendText(msg.to,"It's already off 􀜁􀇔􏿿👈") 692 | else: 693 | cl.sendText(msg.to,"Already off") 694 | else: 695 | wait["linkprotect"] = False 696 | if wait["lang"] == "JP": 697 | cl.sendText(msg.to,"Protect QR off 􀜁􀇔􏿿") 698 | else: 699 | cl.sendText(msg.to,"Already off") 700 | elif msg.text.lower() == 'auto join off': 701 | if wait["autoJoin"] == False: 702 | if wait["lang"] == "JP": 703 | cl.sendText(msg.to,"Auto Join Already Off") 704 | else: 705 | cl.sendText(msg.to,"Auto Join set off") 706 | else: 707 | wait["autoJoin"] = False 708 | if wait["lang"] == "JP": 709 | cl.sendText(msg.to,"already close") 710 | else: 711 | cl.sendText(msg.to,"It is already open ô€œ👈") 712 | elif msg.text in ["Protect off"]: 713 | if wait["protect"] == False: 714 | if wait["lang"] == "JP": 715 | cl.sendText(msg.to,"this hall is off ô€œ👈") 716 | else: 717 | cl.sendText(msg.to,"already turned off ô€œô€„‰👈") 718 | else: 719 | wait["protect"] = False 720 | if wait["lang"] == "JP": 721 | cl.sendText(msg.to,"already close") 722 | else: 723 | cl.sendText(msg.to,"It is already open ô€œ👈") 724 | elif msg.text in ["Qrprotect off","qrprotect off"]: 725 | if wait["linkprotect"] == False: 726 | if wait["lang"] == "JP": 727 | cl.sendText(msg.to,"this hall is off ô€œ👈") 728 | else: 729 | cl.sendText(msg.to,"already turned off ô€œô€„‰👈") 730 | else: 731 | wait["linkprotect"] = False 732 | if wait["lang"] == "JP": 733 | cl.sendText(msg.to,"already close") 734 | else: 735 | cl.sendText(msg.to,"It is already open ô€œ👈") 736 | elif msg.text in ["Inviteprotect off"]: 737 | if wait["inviteprotect"] == False: 738 | if wait["lang"] == "JP": 739 | cl.sendText(msg.to,"this hall is off ô€œ👈") 740 | else: 741 | cl.sendText(msg.to,"already turned off ô€œô€„‰👈") 742 | else: 743 | wait["inviteprotect"] = False 744 | if wait["lang"] == "JP": 745 | cl.sendText(msg.to,"already close") 746 | else: 747 | cl.sendText(msg.to,"It is already open ô€œ👈") 748 | elif msg.text in ["Cancelprotect off"]: 749 | if wait["cancelprotect"] == False: 750 | if wait["lang"] == "JP": 751 | cl.sendText(msg.to,"this hall is off ô€œ👈") 752 | else: 753 | cl.sendText(msg.to,"already turned off​ ô€œô€„‰👈") 754 | else: 755 | wait["cancelprotect"] = False 756 | if wait["lang"] == "JP": 757 | cl.sendText(msg.to,"already close") 758 | else: 759 | cl.sendText(msg.to,"It is already open ô€œ👈") 760 | elif "Group cancel: " in msg.text: 761 | try: 762 | strnum = msg.text.replace("Group cancel: ","") 763 | if strnum == "off": 764 | wait["autoCancel"]["on"] = False 765 | if wait["lang"] == "JP": 766 | cl.sendText(msg.to,"It was off invitation denied👈\nPlease send by determining the number of people when you turn on👈") 767 | else: 768 | cl.sendText(msg.to,"Off invitation denied👈Mention the amount open when you want to send") 769 | else: 770 | num = int(strnum) 771 | wait["autoCancel"]["on"] = True 772 | if wait["lang"] == "JP": 773 | cl.sendText(msg.to,strnum + "The following groups invited will be automatically rejected👈") 774 | else: 775 | cl.sendText(msg.to,strnum + "The team declined to create the following automatic invitation") 776 | except: 777 | if wait["lang"] == "JP": 778 | kk.sendText(msg.to,"The value is incorrect👈") 779 | else: 780 | cl.sendText(msg.to,"Weird value🛡") 781 | elif msg.text in ["Leave on","Auto leave: on"]: 782 | if wait["leaveRoom"] == True: 783 | if wait["lang"] == "JP": 784 | cl.sendText(msg.to,"on👈􀜁􀇔􏿿") 785 | else: 786 | cl.sendText(msg.to,"Already opened􀜁􀇔􏿿") 787 | else: 788 | wait["leaveRoom"] = True 789 | if wait["lang"] == "JP": 790 | cl.sendText(msg.to,"Done👈􀜁􀇔􏿿") 791 | else: 792 | cl.sendText(msg.to,"Is already open👈􀜁􀇔􏿿") 793 | elif msg.text in ["Leave off","Auto leave: off"]: 794 | if wait["leaveRoom"] == False: 795 | if wait["lang"] == "JP": 796 | cl.sendText(msg.to,"on👈􀜁􀇔􏿿") 797 | else: 798 | cl.sendText(msg.to,"It's off👈􀜁􀇔􏿿") 799 | else: 800 | wait["leaveRoom"] = False 801 | if wait["lang"] == "JP": 802 | cl.sendText(msg.to,"Done👈􀜁􀇔􏿿") 803 | else: 804 | cl.sendText(msg.to,"Is already close👈􀜁􀇔􏿿") 805 | elif msg.text in ["Share on","share on"]: 806 | if wait["timeline"] == True: 807 | if wait["lang"] == "JP": 808 | cl.sendText(msg.to,"Done 􀜁􀇔􏿿") 809 | else: 810 | cl.sendText(msg.to,"Hal ini sudah terbuka👈") 811 | else: 812 | wait["timeline"] = True 813 | if wait["lang"] == "JP": 814 | cl.sendText(msg.to,"on👈") 815 | else: 816 | cl.sendText(msg.to,"on👈") 817 | elif msg.text in ["Share off","share off"]: 818 | if wait["timeline"] == False: 819 | if wait["lang"] == "JP": 820 | cl.sendText(msg.to,"Done👈􀜁􀇔􏿿") 821 | else: 822 | cl.sendText(msg.to,"It is already turned off 􀜁􀇔􏿿👈") 823 | else: 824 | wait["timeline"] = False 825 | if wait["lang"] == "JP": 826 | cl.sendText(msg.to,"Off👈") 827 | else: 828 | cl.sendText(msg.to,"Off👈") 829 | elif msg.text.lower() == 'settings': 830 | md = "" 831 | if wait["contact"] == True: md+="☞ Contact → ✔\n" 832 | else: md+="☞ Contact → ❌\n" 833 | if wait["autoJoin"] == True: md+="☞ Auto Join → ✔\n" 834 | else: md+="☞ Auto Join → ❌\n" 835 | if wait["autoCancel"]["on"] == True:md+="☞ Auto cancel: " + str(wait["autoCancel"]["members"]) + " → ✔\n" 836 | else: md+="☞ Group cancel → ❌\n" 837 | if wait["leaveRoom"] == True: md+="☞ Auto leave → ✔\n" 838 | else: md+="☞ Auto leave → ❌\n" 839 | if wait["timeline"] == True: md+="☞ share → ✔\n" 840 | else:md+="☞ Share → ❌\n" 841 | if wait["autoAdd"] == True: md+="☞ Auto add → ✔\n" 842 | else:md+="☞ Auto add → ❌\n" 843 | if wait["commentOn"] == True: md+="☞ Auto comment → ✔\n" 844 | else:md+="☞ Auto comment → ❌\n" 845 | if wait["protect"] == True: md+="☞ Protect → ✔\n" 846 | else:md+="☞ Protect → ❌\n" 847 | if wait["linkprotect"] == True: md+="☞ Link Protect → ✔\n" 848 | else:md+="☞ Link Protect → ❌\n" 849 | if wait["inviteprotect"] == True: md+="☞ Invitation Protect → ✔\n" 850 | else:md+="☞ Invitation Protect → ❌\n" 851 | if wait["cancelprotect"] == True: md+="☞ Cancel Protect → ✔\n" 852 | else:md+="☞ Cancel Protect → ❌\n" 853 | if wait["likeOn"] == True: md+="☞ Auto like → ✔\n" 854 | else:md+="☞ Auto like → ❌\n" 855 | cl.sendText(msg.to,md) 856 | #msg.contentType = 13 857 | #msg.contentMetadata = {'mid': admsa} 858 | #cl.sendMessage(msg) 859 | 860 | elif msg.text in ["Like:on"]: 861 | if wait["likeOn"] == True: 862 | if wait["lang"] == "JP": 863 | cl.sendText(msg.to,"Done。") 864 | else: 865 | wait["likeOn"] = True 866 | if wait["lang"] == "JP": 867 | cl.sendText(msg.to,"Already。") 868 | elif msg.text in ["いいね:オフ","Like:off"]: 869 | if wait["likeOn"] == False: 870 | if wait["lang"] == "JP": 871 | cl.sendText(msg.to,"Done。") 872 | else: 873 | wait["likeOn"] = False 874 | if wait["lang"] == "JP": 875 | cl.sendText(msg.to,"Already。") 876 | 877 | elif msg.text in ["Add on","Add auto on"]: 878 | if wait["autoAdd"] == True: 879 | if wait["lang"] == "JP": 880 | cl.sendText(msg.to,"Already On") 881 | else: 882 | cl.sendText(msg.to,"Already On👈") 883 | else: 884 | wait["autoAdd"] = True 885 | if wait["lang"] == "JP": 886 | cl.sendText(msg.to,"Already On👈") 887 | else: 888 | cl.sendText(msg.to,"Already On👈") 889 | elif msg.text in ["Add off","Add auto off"]: 890 | if wait["autoAdd"] == False: 891 | if wait["lang"] == "JP": 892 | cl.sendText(msg.to,"It is already off👈") 893 | else: 894 | cl.sendText(msg.to,"It is already turned off👈") 895 | else: 896 | wait["autoAdd"] = False 897 | if wait["lang"] == "JP": 898 | cl.sendText(msg.to,"Already Off👈") 899 | else: 900 | cl.sendText(msg.to,"To enable-off👈") 901 | elif "Message set: " in msg.text: 902 | wait["message"] = msg.text.replace("Message set: ","") 903 | cl.sendText(msg.to,"We changed the message👈") 904 | elif "Help set: " in msg.text: 905 | wait["help"] = msg.text.replace("Help set: ","") 906 | cl.sendText(msg.to,"We changed the Help👈") 907 | elif "Pesan add: " in msg.text: 908 | wait["message"] = msg.text.replace("Pesan add: ","") 909 | if wait["lang"] == "JP": 910 | cl.sendText(msg.to,"We changed the message🛡") 911 | else: 912 | cl.sendText(msg.to,"Change information") 913 | elif msg.text in ["Message add check","Message Confirmation"]: 914 | if wait["lang"] == "JP": 915 | cl.sendText(msg.to,"Additional information is automatically set to the following \n\n" + wait["message"]) 916 | else: 917 | cl.sendText(msg.to,"Additional auto messages have been set as follows \n\n" + wait["message"]) 918 | elif msg.text in ["Change","change"]: 919 | if wait["lang"] =="JP": 920 | wait["lang"] = "TW" 921 | cl.sendText(msg.to,"I changed the language to english👈") 922 | else: 923 | wait["lang"] = "JP" 924 | cl.sendText(msg.to,"I changed the language to thai👈") 925 | elif "Message set: " in msg.text: 926 | c = msg.text.replace("Message set: ","") 927 | if c in [""," ","\n",None]: 928 | cl.sendText(msg.to,"Is a string that can not be changed👈") 929 | else: 930 | wait["comment"] = c 931 | cl.sendText(msg.to,"This has been changed👈\n\n" + c) 932 | elif "Comment set: " in msg.text: 933 | c = msg.text.replace("Comment set: ","") 934 | if c in [""," ","\n",None]: 935 | cl.sendText(msg.to,"It is a string that can not be changed👈") 936 | else: 937 | wait["comment"] = c 938 | cl.sendText(msg.to,"This has been changed👈\n\n" + c) 939 | elif msg.text in ["Com on","Com:on","Comment on"]: 940 | if wait["commentOn"] == True: 941 | if wait["lang"] == "JP": 942 | cl.sendText(msg.to,"I was on👈") 943 | else: 944 | cl.sendText(msg.to,"To open👈") 945 | else: 946 | wait["commentOn"] = True 947 | if wait["lang"] == "JP": 948 | cl.sendText(msg.to,"It is already turned on") 949 | else: 950 | cl.sendText(msg.to,"要了开👈") 951 | elif msg.text in ["Com off"]: 952 | if wait["commentOn"] == False: 953 | if wait["lang"] == "JP": 954 | cl.sendText(msg.to,"It is already turned off") 955 | else: 956 | cl.sendText(msg.to,"It is already turned off") 957 | else: 958 | wait["commentOn"] = False 959 | if wait["lang"] == "JP": 960 | cl.sendText(msg.to,"Off👈") 961 | else: 962 | cl.sendText(msg.to,"To turn off") 963 | elif msg.text in ["Com","Comment"]: 964 | cl.sendText(msg.to,"Auto Comment is currently set as follows:👈\n\n" + str(wait["comment"])) 965 | elif msg.text in ["Com Bl"]: 966 | wait["wblack"] = True 967 | cl.sendText(msg.to,"Please send contacts from the person you want to add to the blacklistô€œô€…”👈") 968 | elif msg.text in ["Com hapus Bl"]: 969 | wait["dblack"] = True 970 | cl.sendText(msg.to,"Please send contacts from the person you want to add from the blacklistô€œô€…”👈") 971 | elif msg.text in ["Com Bl cek"]: 972 | if wait["commentBlack"] == {}: 973 | cl.sendText(msg.to,"Nothing in the blacklistô€œ🛡") 974 | else: 975 | cl.sendText(msg.to,"The following is a blacklistô€œ👈") 976 | mc = "" 977 | for mi_d in wait["commentBlack"]: 978 | mc += "・" +cl.getContact(mi_d).displayName + "\n" 979 | cl.sendText(msg.to,mc) 980 | elif msg.text.lower() == 'jam on': 981 | if wait["clock"] == True: 982 | cl.sendText(msg.to,"Sudah On") 983 | else: 984 | wait["clock"] = True 985 | now2 = datetime.now() 986 | nowT = datetime.strftime(now2,"(%H:%M)") 987 | profile = cl.getProfile() 988 | profile.displayName = wait["cName"] + nowT 989 | cl.updateProfile(profile) 990 | cl.sendText(msg.to,"👉Jam on👈") 991 | elif msg.text.lower() == 'jam off': 992 | if wait["clock"] == False: 993 | cl.sendText(msg.to,"It is already off🛡") 994 | else: 995 | wait["clock"] = False 996 | cl.sendText(msg.to,"Is Off") 997 | elif "Jam say: " in msg.text: 998 | n = msg.text.replace("Jam say: ","") 999 | if len(n.decode("utf-8")) > 30: 1000 | cl.sendText(msg.to,"too long") 1001 | else: 1002 | wait["cName"] = n 1003 | cl.sendText(msg.to,"This has been changed🛡\n\n" + n) 1004 | elif msg.text.lower() == 'update': 1005 | if wait["clock"] == True: 1006 | now2 = datetime.now() 1007 | nowT = datetime.strftime(now2,"(%H:%M)") 1008 | profile = cl.getProfile() 1009 | profile.displayName = wait["cName"] + nowT 1010 | cl.updateProfile(profile) 1011 | cl.sendText(msg.to,"Updated👈") 1012 | else: 1013 | cl.sendText(msg.to,"Please Unlock Name") 1014 | 1015 | elif msg.text == "Lurking": 1016 | if msg.toType == 2: 1017 | cl.sendText(msg.to, "Set reading point:" + datetime.now().strftime('\n%Y/%m/%d %H:%M:%S')) 1018 | try: 1019 | del wait2['readPoint'][msg.to] 1020 | del wait2['readMember'][msg.to] 1021 | except: 1022 | pass 1023 | wait2['readPoint'][msg.to] = msg.id 1024 | wait2['readMember'][msg.to] = "" 1025 | wait2['setTime'][msg.to] = datetime.now().strftime('%Y-%m-%d %H:%M:%S') 1026 | wait2['ROM'][msg.to] = {} 1027 | print wait2 1028 | 1029 | elif msg.text == "Result": 1030 | if msg.toType == 2: 1031 | if msg.to in wait2['readPoint']: 1032 | if wait2["ROM"][msg.to].items() == []: 1033 | chiya = "" 1034 | else: 1035 | chiya = "" 1036 | for rom in wait2["ROM"][msg.to].items(): 1037 | print rom 1038 | chiya += rom[1] + "\n" 1039 | 1040 | cl.sendText(msg.to, "---------------\nActive readers:%s\n\n\n\nPassive readers:\n%s\n\n---------------\nIn the last seen point:\n[%s]\n---------------\n [☸]➦Powered By: Ŧяәәƅoŧ•┅─────" % (wait2['readMember'][msg.to],chiya,setTime[msg.to])) 1041 | print "ReadPoint Set..." 1042 | try: 1043 | del wait2['readPoint'][msg.to] 1044 | del wait2['readMember'][msg.to] 1045 | except: 1046 | pass 1047 | wait2['readPoint'][msg.to] = msg.id 1048 | wait2['readMember'][msg.to] = "" 1049 | wait2['setTime'][msg.to] = datetime.now().strftime('%Y-%m-%d %H:%M:%S') 1050 | wait2['ROM'][msg.to] = {} 1051 | print wait 1052 | cl.sendText(msg.to, "Auto set reading point in:" + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S')) 1053 | else: 1054 | cl.sendText(msg.to, "Reading point has not been set.") 1055 | 1056 | #-----------------------[Add Staff Section]------------------------ 1057 | elif "Add staff @" in msg.text: 1058 | if msg.from_ in admin: 1059 | print "[Command]Staff add executing" 1060 | _name = msg.text.replace("Add staff @","") 1061 | _nametarget = _name.rstrip(' ') 1062 | gs = cl.getGroup(msg.to) 1063 | targets = [] 1064 | for g in gs.members: 1065 | if _nametarget == g.displayName: 1066 | targets.append(g.mid) 1067 | if targets == []: 1068 | cl.sendText(msg.to,"Contact not found") 1069 | else: 1070 | for target in targets: 1071 | try: 1072 | staff.append(target) 1073 | cl.sendText(msg.to,"Added to the staff list") 1074 | except: 1075 | pass 1076 | print "[Command]Staff add executed" 1077 | else: 1078 | cl.sendText(msg.to,"Command denied.") 1079 | cl.sendText(msg.to,"Admin permission required.") 1080 | 1081 | elif "Remove staff @" in msg.text: 1082 | if msg.from_ in admin: 1083 | print "[Command]Staff remove executing" 1084 | _name = msg.text.replace("Remove staff @","") 1085 | _nametarget = _name.rstrip(' ') 1086 | gs = cl.getGroup(msg.to) 1087 | targets = [] 1088 | for g in gs.members: 1089 | if _nametarget == g.displayName: 1090 | targets.append(g.mid) 1091 | if targets == []: 1092 | ki.sendText(msg.to,"Contact not found") 1093 | else: 1094 | for target in targets: 1095 | try: 1096 | staff.remove(target) 1097 | cl.sendText(msg.to,"Removed to the staff list") 1098 | except: 1099 | pass 1100 | print "[Command]Staff remove executed" 1101 | else: 1102 | cl.sendText(msg.to,"Command denied.") 1103 | cl.sendText(msg.to,"Admin permission required.") 1104 | 1105 | elif msg.text in ["Stafflist","stafflist"]: 1106 | if staff == []: 1107 | cl.sendText(msg.to,"The stafflist is empty") 1108 | else: 1109 | cl.sendText(msg.to,"Staff list: ") 1110 | mc = "" 1111 | for mi_d in staff: 1112 | mc += "->" +cl.getContact(mi_d).displayName + "\n" 1113 | cl.sendText(msg.to,mc) 1114 | print "[Command]Stafflist executed" 1115 | 1116 | #----------------------ADMIN COMMAND------------------------------# 1117 | 1118 | elif ("Kick " in msg.text): 1119 | if msg.from_ in admin: 1120 | targets = [] 1121 | key = eval(msg.contentMetadata["MENTION"]) 1122 | key["MENTIONEES"][0]["M"] 1123 | for x in key["MENTIONEES"]: 1124 | targets.append(x["M"]) 1125 | for target in targets: 1126 | try: 1127 | cl.kickoutFromGroup(msg.to,[target]) 1128 | except: 1129 | cl.sendText(msg.to,"Error") 1130 | 1131 | elif "Tagall" in msg.text: 1132 | group = cl.getGroup(msg.to) 1133 | k = len(group.members)//500 1134 | for j in xrange(k+1): 1135 | msg = Message(to=msg.to) 1136 | txt = u'' 1137 | s=0 1138 | d=[] 1139 | for i in group.members[j*500 : (j+1)*500]: 1140 | d.append({"S":str(s), "E" :str(s+8), "M":i.mid}) 1141 | s += 9 1142 | txt += u'@Krampus\n' 1143 | msg.text = txt 1144 | msg.contentMetadata = {u'MENTION':json.dumps({"MENTIONEES":d})} 1145 | cl.sendMessage(msg) 1146 | 1147 | elif "Ratakan" in msg.text: 1148 | if msg.from_ in admin: 1149 | nk0 = msg.text.replace("Ratakan","") 1150 | nk1 = nk0.lstrip() 1151 | nk2 = nk1.replace("all","") 1152 | nk3 = nk2.rstrip() 1153 | _name = nk3 1154 | gs = cl.getGroup(msg.to) 1155 | targets = [] 1156 | for g in gs.members: 1157 | if _name in g.displayName: 1158 | targets.append(g.mid) 1159 | if targets == []: 1160 | cl.sendText(msg.to,"user does not exist") 1161 | pass 1162 | else: 1163 | for target in targets: 1164 | if not target in Bots: 1165 | if not target in admin: 1166 | try: 1167 | klist=[cl,ki,ki2,ki3,ki4,ki5] 1168 | kicker=random.choice(klist) 1169 | kicker.kickoutFromGroup(msg.to,[target]) 1170 | print (msg.to,[g.mid]) 1171 | except: 1172 | cl.sendText(msg.to,"Success Bosqu") 1173 | cl.sendText(msg.to,"Christ Mouko Sundla") 1174 | 1175 | elif msg.text in ["List grup"]: 1176 | if msg.from_ in admin: 1177 | gid = cl.getGroupIdsJoined() 1178 | h = "===[List Groups]===" 1179 | total = str(len(gid)) 1180 | for i in gid: 1181 | if i is not None: 1182 | try: 1183 | groups = cl.getGroup(i) 1184 | if groups.members is not None: 1185 | members = str(len(groups.members)) 1186 | else: 1187 | members = "0" 1188 | if groups.invitee is not None: 1189 | pendings = str(len(groups.invitee)) 1190 | else: 1191 | pendings = "0" 1192 | h += "\n[" + groups.name + "] ->(" + members +")\n -+GroupID : " + i 1193 | except: 1194 | break 1195 | else: 1196 | break 1197 | if gid is not None: 1198 | cl.sendText(msg.to,h + "\n|[Total Groups]| : " + str(total)) 1199 | else: 1200 | cl.sendText(msg.to,"There are no groups at this time") 1201 | ginv = cl.getGroupIdsInvited() 1202 | j = "===[List Groups Invited]===" 1203 | totals = str(len(ginv)) 1204 | for z in ginv: 1205 | if z is not None: 1206 | try: 1207 | groups = cl.getGroup(z) 1208 | if groups.members is not None: 1209 | members = str(len(groups.members)) 1210 | else: 1211 | members = "0" 1212 | if groups.invitee is not None: 1213 | pendings = str(len(groups.invitee)) 1214 | else: 1215 | pendings = "0" 1216 | j += "\n[" + groups.name + "] ->(" + members + ")\n -+GroupID : " + i 1217 | except: 1218 | break 1219 | else: 1220 | break 1221 | if ginv is not None: 1222 | cl.sendText(msg.to,j + "\n|[Total Groups Invited]| : " + str(totals)) 1223 | else: 1224 | cl.sendText(msg.to,"There are no pending groups at this time") 1225 | 1226 | elif msg.text in ["Info grup"]: 1227 | if msg.from_ in admin: 1228 | gid = cl.getGroupIdsJoined() 1229 | cl.sendText(msg.to,"===[List Details Group]===") 1230 | total = str(len(gid)) 1231 | for i in gid: 1232 | if i is not None: 1233 | try: 1234 | groups = ki.getGroup(i) 1235 | if groups.members is not None: 1236 | members = str(len(groups.members)) 1237 | else: 1238 | members = "0" 1239 | if groups.invitee is not None: 1240 | pendings = str(len(groups.invitee)) 1241 | else: 1242 | pendings = "0" 1243 | h = "[" + groups.name + "]\n -+GroupID : " + i + "\n -+Members : " + members + "\n -+MembersPending : " + pendings + "\n -+Creator : " + groups.creator.displayName 1244 | except: 1245 | break 1246 | else: 1247 | break 1248 | if gid is not None: 1249 | cl.sendText(msg.to,h) 1250 | cl.sendText(msg.to,"|[Total Groups]| : " + str(total)) 1251 | else: 1252 | cl.sendText(msg.to,"There are no groups at this time") 1253 | ginv = cl.getGroupIdsInvited() 1254 | cl.sendText(msg.to,"===[List Details Groups Invited]===") 1255 | totals = str(len(ginv)) 1256 | for z in ginv: 1257 | if z is not None: 1258 | try: 1259 | groups = cl.getGroup(z) 1260 | if groups.members is not None: 1261 | members = str(len(groups.members)) 1262 | else: 1263 | members = "0" 1264 | if groups.invitee is not None: 1265 | pendings = str(len(groups.invitee)) 1266 | else: 1267 | pendings = "0" 1268 | j = "[" + groups.name + "]\n -+GroupID : " + i + "\n -+Members : " + members + "\n -+MembersPending : " + pendings + "\n -+Creator : " + groups.creator.displayName 1269 | except: 1270 | break 1271 | else: 1272 | break 1273 | if ginv is not None: 1274 | cl.sendText(msg.to,j) 1275 | cl.sendText(msg.to,"|[Total Groups Invited]| : " + str(totals)) 1276 | else: 1277 | cl.sendText(msg.to,"There are no pending groups at this time") 1278 | 1279 | elif "Details grup: " in msg.text: 1280 | if msg.from_ in admin: 1281 | gid = msg.text.replace("/DetailsGroup: ","") 1282 | if gid in [""," "]: 1283 | cl.sendText(msg.to,"Invalid id group") 1284 | else: 1285 | try: 1286 | groups = cl.getGroup(gid) 1287 | if groups.members is not None: 1288 | members = str(len(groups.members)) 1289 | else: 1290 | members = "0" 1291 | if groups.invitee is not None: 1292 | pendings = str(len(groups.invitee)) 1293 | else: 1294 | pendings = "0" 1295 | h = "[" + groups.name + "]\n -+GroupID : " + gid + "\n -+Members : " + members + "\n -+MembersPending : " + pendings + "\n -+Creator : " + groups.creator.displayName + "\n -+GroupPicture : http://dl.profile.line.naver.jp/" + groups.pictureStatus 1296 | cl.sendText(msg.to,h) 1297 | except Exception as error: 1298 | cl.sendText(msg.to,(error)) 1299 | 1300 | elif "Cancel invite: " in msg.text: 1301 | if msg.from_ in admin: 1302 | gids = msg.text.replace("Cancel invite: ","") 1303 | gid = cl.getGroup(gids) 1304 | for i in gid: 1305 | if i is not None: 1306 | try: 1307 | cl.rejectGroupInvitation(i) 1308 | except: 1309 | cl.sendText(msg.to,"Error!") 1310 | break 1311 | else: 1312 | break 1313 | if gid is not None: 1314 | cl.sendText(msg.to,"Successfully rejected the invite from the group " + gid.name) 1315 | else: 1316 | cl.sendText(msg.to,"Group not found") 1317 | 1318 | elif msg.text in ["Accept invite"]: 1319 | if msg.from_ in admin: 1320 | gid = cl.getGroupIdsInvited() 1321 | _list = "" 1322 | for i in gid: 1323 | if i is not None: 1324 | gids = cl.getGroup(i) 1325 | _list += gids.name 1326 | cl.acceptGroupInvitation(i) 1327 | else: 1328 | break 1329 | if gid is not None: 1330 | cl.sendText(msg.to,"Successfully accepted all invites from the group :\n" + _list) 1331 | else: 1332 | cl.sendText(msg.to,"There are no pending groups at this time") 1333 | 1334 | elif "Myname: " in msg.text: 1335 | string = msg.text.replace("Myname: ","") 1336 | if len(string.decode('utf-8')) <= 20: 1337 | profile = cl.getProfile() 1338 | profile.displayName = string 1339 | cl.updateProfile(profile) 1340 | cl.sendText(msg.to,"Update Bio" + string) 1341 | 1342 | elif "Mybio: " in msg.text: 1343 | string = msg.text.replace("Mybio: ","") 1344 | if len(string.decode('utf-8')) <= 500: 1345 | profile = cl.getProfile() 1346 | profile.statusMessage = string 1347 | cl.updateProfile(profile) 1348 | cl.sendText(msg.to,"Update Bio" + string) 1349 | 1350 | elif ("Gname: " in msg.text): 1351 | if msg.toType == 2: 1352 | group = cl.getGroup(msg.to) 1353 | group.name = msg.text.replace("Gname: ","") 1354 | cl.updateGroup(group) 1355 | else: 1356 | cl.sendText(msg.to,"Can not Change Group Name") 1357 | 1358 | elif "Kick: " in msg.text: 1359 | if msg.from_ in admin: 1360 | midd = msg.text.replace("Kick: ","") 1361 | cl.kickoutFromGroup(msg.to,[midd]) 1362 | elif "Invite: " in msg.text: 1363 | if msg.from_ in admin: 1364 | midd = msg.text.replace("Invite: ","") 1365 | cl.findAndAddContactsByMid(midd) 1366 | cl.inviteIntoGroup(msg.to,[midd]) 1367 | 1368 | elif "Mysteal @" in msg.text: 1369 | print "[Command]dp executing" 1370 | _name = msg.text.replace("Mysteal @","") 1371 | _nametarget = _name.rstrip(' ') 1372 | gs = cl.getGroup(msg.to) 1373 | targets = [] 1374 | for g in gs.members: 1375 | if _nametarget == g.displayName: 1376 | targets.append(g.mid) 1377 | if targets == []: 1378 | cl.sendText(msg.to,"Contact not found") 1379 | else: 1380 | for target in targets: 1381 | try: 1382 | contact = cl.getContact(target) 1383 | path = "http://dl.profile.line-cdn.net/" + contact.pictureStatus 1384 | cl.sendImageWithURL(msg.to, path) 1385 | except: 1386 | pass 1387 | print "[Command]dp executed" 1388 | 1389 | elif "Mycopy @" in msg.text: 1390 | if msg.toType == 2: 1391 | if msg.from_ in admin: 1392 | print "[COPY] Ok" 1393 | _name = msg.text.replace("Mycopy @","") 1394 | _nametarget = _name.rstrip(' ') 1395 | gs = cl.getGroup(msg.to) 1396 | targets = [] 1397 | for g in gs.members: 1398 | if _nametarget == g.displayName: 1399 | targets.append(g.mid) 1400 | if targets == []: 1401 | cl.sendText(msg.to, "Not Found...") 1402 | else: 1403 | for target in targets: 1404 | try: 1405 | cl.cloneContactProfile(target) 1406 | cl.sendText(msg.to, "Sukses Copy Profile") 1407 | except Exception as e: 1408 | print e 1409 | 1410 | elif "Copy @" in msg.text: 1411 | if msg.toType == 2: 1412 | if msg.from_ in admin: 1413 | print "[COPY] Ok" 1414 | _name = msg.text.replace("Copy @","") 1415 | _nametarget = _name.rstrip(' ') 1416 | gs = cl.getGroup(msg.to) 1417 | targets = [] 1418 | for g in gs.members: 1419 | if _nametarget == g.displayName: 1420 | targets.append(g.mid) 1421 | if targets == []: 1422 | cl.sendText(msg.to, "No Target Copy") 1423 | else: 1424 | for target in targets: 1425 | try: 1426 | ki.cloneContactProfile(target) 1427 | ki2.cloneContactProfile(target) 1428 | ki3.cloneContactProfile(target) 1429 | ki4.cloneContactProfile(target) 1430 | ki5.cloneContactProfile(target) 1431 | cl.sendText(msg.to, "Success Copy Profile") 1432 | except Exception as e: 1433 | print e 1434 | 1435 | elif msg.text in ["Mybackup"]: 1436 | try: 1437 | cl.updateDisplayPicture(mybackup.pictureStatus) 1438 | cl.updateProfile(mybackup) 1439 | cl.sendText(msg.to, "Backup Success Bosqu") 1440 | except Exception as e: 1441 | cl.sendText(msg.to, str (e)) 1442 | 1443 | elif msg.text in ["Backup"]: 1444 | try: 1445 | ki.updateDisplayPicture(backup.pictureStatus) 1446 | ki.updateProfile(backup) 1447 | ki2.updateDisplayPicture(backup.pictureStatus) 1448 | ki2.updateProfile(backup) 1449 | ki3.updateDisplayPicture(backup.pictureStatus) 1450 | ki3.updateProfile(backup) 1451 | ki4.updateDisplayPicture(backup.pictureStatus) 1452 | ki4.updateProfile(backup) 1453 | ki5.updateDisplayPicture(backup.pictureStatus) 1454 | ki5.updateProfile(backup) 1455 | cl.sendText(msg.to, "Backup Success Bosqu") 1456 | except Exception as e: 1457 | cl.sendText(msg.to, str (e)) 1458 | 1459 | elif "Bc:ct " in msg.text: 1460 | bctxt = msg.text.replace("Bc:ct ", "") 1461 | a = cl.getAllContactIds() 1462 | for manusia in a: 1463 | cl.sendText(manusia, (bctxt)) 1464 | 1465 | elif "Bot:ct " in msg.text: 1466 | if msg.from_ in admin: 1467 | bctxt = msg.text.replace("Bot:ct ", "") 1468 | b = ki.getAllContactIds() 1469 | for manusia in b: 1470 | ki.sendText(manusia, (bctxt)) 1471 | c = ki2.getAllContactIds() 1472 | for manusia in c: 1473 | ki2.sendText(manusia, (bctxt)) 1474 | d = ki3.getAllContactIds() 1475 | for manusia in d: 1476 | ki3.sendText(manusia, (bctxt)) 1477 | e = ki4.getAllContactIds() 1478 | for manusia in e: 1479 | ki4.sendText(manusia, (bctxt)) 1480 | f = ki5.getAllContactIds() 1481 | for manusia in f: 1482 | ki5.sendText(manusia, (bctxt)) 1483 | elif "Bc:grup " in msg.text: 1484 | bctxt = msg.text.replace("Bc:grup ", "") 1485 | a = cl.getGroupIdsJoined() 1486 | for manusia in a: 1487 | cl.sendText(manusia, (bctxt)) 1488 | 1489 | elif "Bot:grup " in msg.text: 1490 | if msg.from_ in admin: 1491 | bctxt = msg.text.replace("Bot:grup ", "") 1492 | b = ki.getGroupIdsJoined() 1493 | for manusia in b: 1494 | ki.sendText(manusia, (bctxt)) 1495 | c = ki2.getGroupIdsJoined() 1496 | for manusia in c: 1497 | ki2.sendText(manusia, (bctxt)) 1498 | d = ki3.getGroupIdsJoined() 1499 | for manusia in d: 1500 | ki3.sendText(manusia, (bctxt)) 1501 | e = ki4.getGroupIdsJoined() 1502 | for manusia in e: 1503 | ki4.sendText(manusia, (bctxt)) 1504 | f = ki5.getGroupIdsJoined() 1505 | for manusia in f: 1506 | ki5.sendText(manusia, (bctxt)) 1507 | elif "Spam " in msg.text: 1508 | txt = msg.text.split(" ") 1509 | jmlh = int(txt[2]) 1510 | teks = msg.text.replace("Spam "+str(txt[1])+" "+str(jmlh)+" ","") 1511 | tulisan = jmlh * (teks+"\n") 1512 | if txt[1] == "on": 1513 | if jmlh <= 100000: 1514 | for x in range(jmlh): 1515 | cl.sendText(msg.to, teks) 1516 | else: 1517 | cl.sendText(msg.to, "Out of Range!") 1518 | elif txt[1] == "off": 1519 | if jmlh <= 100000: 1520 | cl.sendText(msg.to, tulisan) 1521 | else: 1522 | cl.sendText(msg.to, "Out Of Range!") 1523 | 1524 | elif msg.text in ["Sp","Speed","speed"]: 1525 | start = time.time() 1526 | cl.sendText(msg.to, "Waitting...") 1527 | elapsed_time = time.time() - start 1528 | cl.sendText(msg.to, "%sseconds" % (elapsed_time)) 1529 | 1530 | elif msg.text.lower() == 'me': 1531 | msg.contentType = 13 1532 | msg.contentMetadata = {'mid': mid} 1533 | cl.sendMessage(msg) 1534 | 1535 | elif cms(msg.text,["creator","Creator"]): 1536 | msg.contentType = 13 1537 | msg.contentMetadata = {'mid': admsa} 1538 | cl.sendText(msg.to," My Creator ") 1539 | cl.sendMessage(msg) 1540 | cl.sendText(msg.to," Dont Kick out From group ") 1541 | 1542 | elif "Inviteme: " in msg.text: 1543 | if msg.from_ in admin: 1544 | gid = msg.text.replace("Inviteme: ","") 1545 | if gid == "": 1546 | cl.sendText(msg.to,"Invalid group id") 1547 | else: 1548 | try: 1549 | cl.findAndAddContactsByMid(msg.from_) 1550 | cl.inviteIntoGroup(gid,[msg.from_]) 1551 | except: 1552 | cl.sendText(msg.to,"Maybe I'm not in that group") 1553 | 1554 | elif msg.text in ["Clear grup"]: 1555 | if msg.from_ in admin: 1556 | gid = cl.getGroupIdsJoined() 1557 | gid = ki.getGroupIdsJoined() 1558 | gid = ki2.getGroupIdsJoined() 1559 | gid = ki3.getGroupIdsJoined() 1560 | gid = ki4.getGroupIdsJoined() 1561 | gid = ki5.getGroupIdsJoined() 1562 | for i in gid: 1563 | ki.leaveGroup(i) 1564 | ki2.leaveGroup(i) 1565 | ki3.leaveGroup(i) 1566 | ki4.leaveGroup(i) 1567 | ki5.leaveGroup(i) 1568 | if wait["lang"] == "JP": 1569 | cl.sendText(msg.to,"Bot Exits In all groups") 1570 | else: 1571 | cl.sendText(msg.to,"He decline all invitations") 1572 | 1573 | elif msg.text == "Ginfo": 1574 | group = cl.getGroup(msg.to) 1575 | try: 1576 | gCreator = group.creator.displayName 1577 | except: 1578 | gCreator = "Error" 1579 | md = "[Group Name : ]\n" + group.name + "\n\n[Id Grup : ]\n" + group.id + "\n\n[Group Creator :]\n" + gCreator + "\n\n[Group Image : ]\nhttp://dl.profile.line-cdn.net/" + group.pictureStatus 1580 | if group.preventJoinByTicket is False: md += "\n\nKode Url : Diizinkan" 1581 | else: md += "\n\node Url : Blocked" 1582 | if group.invitee is None: md += "\nNumber of Members : " + str(len(group.members)) + " Orang" + "\nUnanswered Invitations : 0 Orang" 1583 | else: md += "\nNumber of Members : " + str(len(group.members)) + " Orang" + "\nUnanswered Invitations : " + str(len(group.invitee)) + " Orang" 1584 | cl.sendText(msg.to,md) 1585 | 1586 | elif msg.text == "Uni": 1587 | cl.sendText(msg.to,"Hai Perkenalkan.....\nNama saya siapa ya?\n\n1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1\n\nMakasih Sudah Dilihat :)\nJangan Dikick ampun mzz :v") 1588 | 1589 | elif ".music" in msg.text.lower(): 1590 | songname = msg.text.lower().replace(".music","") 1591 | params = {"songname":" songname"} 1592 | r = requests.get('https://ide.fdlrcn.com/workspace/yumi-apis/joox?' + urllib.urlencode(params)) 1593 | data = r.text 1594 | data = json.loads(data) 1595 | for song in data: 1596 | cl.sendMessage(msg.to, song[4]) 1597 | 1598 | elif ".Youtube " in msg.text: 1599 | query = msg.text.replace(".Youtube ","") 1600 | with requests.session() as s: 1601 | s.headers['user-agent'] = 'Mozilla/5.0' 1602 | url = 'http://www.youtube.com/results' 1603 | params = {'search_query': query} 1604 | r = s.get(url, params=params) 1605 | soup = BeautifulSoup(r.content, 'html5lib') 1606 | for a in soup.select('.yt-lockup-title > a[title]'): 1607 | if '&List' not in a['href']: 1608 | cl.sendText(msg.to,'http://www.youtube.com' + a['href'] + a['title']) 1609 | 1610 | elif "Block @" in msg.text: 1611 | if msg.toType == 2: 1612 | print "[block] OK" 1613 | _name = msg.text.replace("Block @","") 1614 | _nametarget = _name.rstrip(' ') 1615 | gs = cl.getGroup(msg.to) 1616 | targets = [] 1617 | for g in gs.members: 1618 | if _nametarget == g.displayName: 1619 | targets.append(g.mid) 1620 | if targets == []: 1621 | cl.sendText(msg.to, "Not Found...") 1622 | else: 1623 | for target in targets: 1624 | try: 1625 | cl.blockContact(target) 1626 | cl.sendText(msg.to, "Success block contact~") 1627 | except Exception as e: 1628 | print e 1629 | 1630 | elif msg.text.lower() == 'blocklist': 1631 | blockedlist = cl.getBlockedContactIds() 1632 | cl.sendText(msg.to, "Please wait...") 1633 | kontak = cl.getContacts(blockedlist) 1634 | num=1 1635 | msgs="User Blocked List\n" 1636 | for ids in kontak: 1637 | msgs+="\n%i. %s" % (num, ids.displayName) 1638 | num=(num+1) 1639 | msgs+="\n\nTotal %i blocked user(s)" % len(kontak) 1640 | cl.sendText(msg.to, msgs) 1641 | 1642 | elif msg.text in ["Glist"]: 1643 | gid = cl.getGroupIdsJoined() 1644 | h = "" 1645 | for i in gid: 1646 | h += "[★] %s\n" % (cl.getGroup(i).name +"→["+str(len(cl.getGroup(i).members))+"]") 1647 | cl.sendText(msg.to,"[List Group]\n"+ h +"Total Group =" +"["+str(len(gid))+"]") 1648 | 1649 | elif msg.text in ["Invite"]: 1650 | if msg.from_ in admin: 1651 | wait["ricoinvite"] = True 1652 | random.choice(KAC).sendText(msg.to,"send contact 😉") 1653 | 1654 | elif ("Check " in msg.text): 1655 | key = eval(msg.contentMetadata["MENTION"]) 1656 | key1 = key["MENTIONEES"][0]["M"] 1657 | mi = cl.getContact(key1) 1658 | cl.sendText(msg.to,"Mid:" + key1) 1659 | 1660 | elif "Mid @" in msg.text: 1661 | if msg.from_ in admin: 1662 | _name = msg.text.replace("Mid @","") 1663 | _nametarget = _name.rstrip(' ') 1664 | gs = cl.getGroup(msg.to) 1665 | for g in gs.members: 1666 | if _nametarget == g.displayName: 1667 | ki.sendText(msg.to, g.mid) 1668 | else: 1669 | pass 1670 | 1671 | elif "Mymid" == msg.text: 1672 | cl.sendText(msg.to,mid) 1673 | 1674 | elif msg.text in ["Link on"]: 1675 | if msg.from_ in admin: 1676 | if msg.toType == 2: 1677 | group = cl.getGroup(msg.to) 1678 | group.preventJoinByTicket = False 1679 | cl.updateGroup(group) 1680 | if wait["lang"] == "JP": 1681 | cl.sendText(msg.to,"URL open") 1682 | else: 1683 | cl.sendText(msg.to,"URL open") 1684 | else: 1685 | if wait["lang"] == "JP": 1686 | cl.sendText(msg.to,"It can not be used outside the group ô€œô€„‰👈") 1687 | else: 1688 | cl.sendText(msg.to,"Can not be used for groups other than ô€œô€„‰") 1689 | 1690 | elif msg.text in ["Link off"]: 1691 | if msg.toType == 2: 1692 | group = cl.getGroup(msg.to) 1693 | group.preventJoinByTicket = True 1694 | cl.updateGroup(group) 1695 | if wait["lang"] == "JP": 1696 | cl.sendText(msg.to,"URL close👈") 1697 | else: 1698 | cl.sendText(msg.to,"URL close👈") 1699 | else: 1700 | if wait["lang"] == "JP": 1701 | cl.sendText(msg.to,"It can not be used outside the group 👈") 1702 | else: 1703 | cl.sendText(msg.to,"Can not be used for groups other than ô€œ") 1704 | 1705 | elif msg.text in ["url","Url"]: 1706 | if msg.toType == 2: 1707 | g = cl.getGroup(msg.to) 1708 | if g.preventJoinByTicket == True: 1709 | g.preventJoinByTicket = False 1710 | cl.updateGroup(g) 1711 | gurl = cl.reissueGroupTicket(msg.to) 1712 | cl.sendText(msg.to,"line://ti/g/" + gurl) 1713 | else: 1714 | if wait["lang"] == "JP": 1715 | cl.sendText(msg.to,"It can not be used outside the group") 1716 | else: 1717 | cl.sendText(msg.to,"Can not be used for groups other than") 1718 | 1719 | elif msg.text in ["Gurl"]: 1720 | if msg.toType == 2: 1721 | x = cl.getGroup(msg.to) 1722 | if x.preventJoinByTicket == True: 1723 | x.preventJoinByTicket = False 1724 | cl.updateGroup(x) 1725 | gurl = cl.reissueGroupTicket(msg.to) 1726 | cl.sendText(msg.to,"line://ti/g/" + gurl) 1727 | else: 1728 | if wait["lang"] == "JP": 1729 | cl.sendText(msg.to,"Can't be used outside the group") 1730 | else: 1731 | cl.sendText(msg.to,"Not for use less than group") 1732 | 1733 | elif msg.text in ["S1glist"]: 1734 | gs = ki.getGroupIdsJoined() 1735 | L = "☫『 Groups List 』☫\n" 1736 | for i in gs: 1737 | L += "[⭐] %s \n" % (ki.getGroup(i).name + " | [ " + str(len (ki.getGroup(i).members)) + " ]") 1738 | ki.sendText(msg.to, L + "\nTotal Group : [ " + str(len(gs)) +" ]") 1739 | elif msg.text in ["S2glist"]: 1740 | gs = ki2.getGroupIdsJoined() 1741 | L = "☫『 Groups List 』☫\n" 1742 | for i in gs: 1743 | L += "[⭐] %s \n" % (ki2.getGroup(i).name + " | [ " + str(len (ki2.getGroup(i).members)) + " ]") 1744 | ki2.sendText(msg.to, L + "\nTotal Group : [ " + str(len(gs)) +" ]") 1745 | elif msg.text in ["S3glist"]: 1746 | gs = ki3.getGroupIdsJoined() 1747 | L = "☫『 Groups List 』☫\n" 1748 | for i in gs: 1749 | L += "[⭐] %s \n" % (ki3.getGroup(i).name + " | [ " + str(len (ki3.getGroup(i).members)) + " ]") 1750 | ki3.sendText(msg.to, L + "\nTotal Group : [ " + str(len(gs)) +" ]") 1751 | elif msg.text in ["S4glist"]: 1752 | gs = ki4.getGroupIdsJoined() 1753 | L = "☫『 Groups List 』☫\n" 1754 | for i in gs: 1755 | L += "[⭐] %s \n" % (ki4.getGroup(i).name + " | [ " + str(len (ki4.getGroup(i).members)) + " ]") 1756 | ki4.sendText(msg.to, L + "\nTotal Group : [ " + str(len(gs)) +" ]") 1757 | elif msg.text in ["S5glist"]: 1758 | gs = ki5.getGroupIdsJoined() 1759 | L = "☫『 Groups List 』☫\n" 1760 | for i in gs: 1761 | L += "[⭐] %s \n" % (ki5.getGroup(i).name + " | [ " + str(len (ki5.getGroup(i).members)) + " ]") 1762 | ki5.sendText(msg.to, L + "\nTotal Group : [ " + str(len(gs)) +" ]") 1763 | elif msg.text == "Link bokep": 1764 | ki.sendText(msg.to,"nekopoi.host") 1765 | ki.sendText(msg.to,"sexvideobokep.com") 1766 | ki.sendText(msg.to,"memek.com") 1767 | ki.sendText(msg.to,"pornktube.com") 1768 | ki.sendText(msg.to,"faketaxi.com") 1769 | ki.sendText(msg.to,"videojorok.com") 1770 | ki.sendText(msg.to,"watchmygf.mobi") 1771 | ki.sendText(msg.to,"xnxx.com") 1772 | ki.sendText(msg.to,"pornhd.com") 1773 | ki.sendText(msg.to,"xvideos.com") 1774 | ki.sendText(msg.to,"vidz7.com") 1775 | ki.sendText(msg.to,"m.xhamster.com") 1776 | ki.sendText(msg.to,"xxmovies.pro") 1777 | ki.sendText(msg.to,"youporn.com") 1778 | ki.sendText(msg.to,"pornhub.com") 1779 | ki.sendText(msg.to,"anyporn.com") 1780 | ki.sendText(msg.to,"hdsexdino.com") 1781 | ki.sendText(msg.to,"rubyourdick.com") 1782 | ki.sendText(msg.to,"anybunny.mobi") 1783 | ki.sendText(msg.to,"cliphunter.com") 1784 | ki.sendText(msg.to,"sexloving.net") 1785 | ki.sendText(msg.to,"free.goshow.tv") 1786 | ki.sendText(msg.to,"eporner.com") 1787 | ki.sendText(msg.to,"Pornhd.josex.net") 1788 | ki.sendText(msg.to,"m.hqporner.com") 1789 | ki.sendText(msg.to,"m.spankbang.com") 1790 | ki.sendText(msg.to,"m.4tube.com") 1791 | ki.sendText(msg.to,"brazzers.com") 1792 | #----------------------------------------------------------- 1793 | elif "#leave" in msg.text: 1794 | try: 1795 | import sys 1796 | sys.exit() 1797 | except: 1798 | pass 1799 | #----------------------------------------------------------- 1800 | elif msg.text in ["Bot sp","Bot speed"]: 1801 | start = time.time() 1802 | ki.sendText(msg.to, "Waiting...") 1803 | elapsed_time = time.time() - start 1804 | ki.sendText(msg.to, "%sseconds" % (elapsed_time)) 1805 | elapsed_time = time.time() - start 1806 | ki2.sendText(msg.to, "%sseconds" % (elapsed_time)) 1807 | elapsed_time = time.time() - start 1808 | ki3.sendText(msg.to, "%sseconds" % (elapsed_time)) 1809 | elapsed_time = time.time() - start 1810 | ki4.sendText(msg.to, "%sseconds" % (elapsed_time)) 1811 | elapsed_time = time.time() - start 1812 | 1813 | elif msg.text.lower() == 'responsname': 1814 | profile = ki.getProfile() 1815 | text = profile.displayName 1816 | ki.sendText(msg.to, text) 1817 | profile = ki2.getProfile() 1818 | text = profile.displayName 1819 | ki2.sendText(msg.to, text) 1820 | profile = ki3.getProfile() 1821 | text = profile.displayName 1822 | ki3.sendText(msg.to, text) 1823 | profile = ki4.getProfile() 1824 | text = profile.displayName 1825 | ki4.sendText(msg.to, text) 1826 | 1827 | #------------------------------------------------------------------ 1828 | elif "Steal home @" in msg.text: 1829 | print "[Command]dp executing" 1830 | _name = msg.text.replace("Steal home @","") 1831 | _nametarget = _name.rstrip(' ') 1832 | gs = cl.getGroup(msg.to) 1833 | targets = [] 1834 | for g in gs.members: 1835 | if _nametarget == g.displayName: 1836 | targets.append(g.mid) 1837 | if targets == []: 1838 | ki.sendText(msg.to,"Contact not found") 1839 | else: 1840 | for target in targets: 1841 | try: 1842 | contact = cl.getContact(target) 1843 | cu = cl.channel.getCover(target) 1844 | path = str(cu) 1845 | cl.sendImageWithURL(msg.to, path) 1846 | except: 1847 | pass 1848 | print "[Command]dp executed" 1849 | #------------------------------------------------------------------ 1850 | elif "Blacklist @" in msg.text: 1851 | if msg.from_ in admin: 1852 | if msg.toType == 2: 1853 | print "[BL]ok" 1854 | _name = msg.text.replace("Blacklist @","") 1855 | _nametarget = _name.rstrip(' ') 1856 | gs = cl.getGroup(msg.to) 1857 | targets = [] 1858 | for g in gs.members: 1859 | if _nametarget == g.displayName: 1860 | targets.append(g.mid) 1861 | if targets == []: 1862 | cl.sendText(msg.to,"Not found.") 1863 | else: 1864 | for target in targets: 1865 | try: 1866 | wait["blacklist"][target] = True 1867 | f=codecs.open('st2__b.json','w','utf-8') 1868 | json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) 1869 | cl.sendText(msg.to,"Success Boss") 1870 | except: 1871 | cl.sendText(msg.to,"Error") 1872 | 1873 | elif "Blacklist all" in msg.text: 1874 | if msg.from_ in admin: 1875 | if msg.toType == 2: 1876 | print "ok" 1877 | _name = msg.text.replace("Blacklist all","") 1878 | gs = cl.getGroup(msg.to) 1879 | cl.sendText(msg.to,"Semua Telah Di Hapus") 1880 | targets = [] 1881 | for g in gs.members: 1882 | if _name in g.displayName: 1883 | targets.append(g.mid) 1884 | if targets == []: 1885 | cl.sendText(msg.to,"Maaf") 1886 | else: 1887 | for target in targets: 1888 | if not target in Bots: 1889 | try: 1890 | wait["blacklist"][target] = True 1891 | f=codecs.open('st2__b.json','w','utf-8') 1892 | json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) 1893 | cl.sendText(msg.to,"Success Boss") 1894 | except: 1895 | cl.sentText(msg.to,"Berhasil Dihapus") 1896 | 1897 | elif "Whitelist @" in msg.text: 1898 | if msg.from_ in admin: 1899 | if msg.toType == 2: 1900 | print "[WL]ok" 1901 | _name = msg.text.replace("Whitelist @","") 1902 | _nametarget = _name.rstrip(' ') 1903 | gs = ki.getGroup(msg.to) 1904 | targets = [] 1905 | for g in gs.members: 1906 | if _nametarget == g.displayName: 1907 | targets.append(g.mid) 1908 | if targets == []: 1909 | ki.sendText(msg.to,"Not found.") 1910 | else: 1911 | for target in targets: 1912 | try: 1913 | del wait["blacklist"][target] 1914 | f=codecs.open('st2__b.json','w','utf-8') 1915 | json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) 1916 | cl.sendText(msg.to,"Success Boss") 1917 | except: 1918 | cl.sendText(msg.to,"There was no blacklist user") 1919 | 1920 | elif "Blacklist: " in msg.text: 1921 | if msg.from_ in admin: 1922 | nk0 = msg.text.replace("Blacklist: ","") 1923 | nk1 = nk0.lstrip() 1924 | nk2 = nk1.replace("","") 1925 | nk3 = nk2.rstrip() 1926 | _name = nk3 1927 | gs = cl.getGroup(msg.to) 1928 | targets = [] 1929 | for s in gs.members: 1930 | if _name in s.displayName: 1931 | targets.append(s.mid) 1932 | if targets == []: 1933 | sendMessage(msg.to,"user does not exist") 1934 | pass 1935 | else: 1936 | for target in targets: 1937 | try: 1938 | wait["blacklist"][target] = True 1939 | f=codecs.open('st2__b.json','w','utf-8') 1940 | json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) 1941 | cl.sendText(msg.to,"Target Locked") 1942 | except: 1943 | cl.sendText(msg.to,"Error") 1944 | 1945 | elif "Whitelist: " in msg.text: 1946 | if msg.from_ in admin: 1947 | nk0 = msg.text.replace("Whitelist: ","") 1948 | nk1 = nk0.lstrip() 1949 | nk2 = nk1.replace("","") 1950 | nk3 = nk2.rstrip() 1951 | _name = nk3 1952 | gs = cl.getGroup(msg.to) 1953 | targets = [] 1954 | for s in gs.members: 1955 | if _name in s.displayName: 1956 | targets.append(s.mid) 1957 | if targets == []: 1958 | sendMessage(msg.to,"user does not exist") 1959 | pass 1960 | else: 1961 | for target in targets: 1962 | try: 1963 | del wait["blacklist"][target] 1964 | f=codecs.open('st2__b.json','w','utf-8') 1965 | json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) 1966 | cl.sendText(msg.to,"Target Unlocked") 1967 | except: 1968 | cl.sendText(msg.to,"Error") 1969 | 1970 | elif msg.text in ["Clear ban"]: 1971 | if msg.from_ in admin: 1972 | wait["blacklist"] = {} 1973 | cl.sendText(msg.to,"clear") 1974 | elif msg.text in ["Whitelist"]: 1975 | if msg.from_ in admin: 1976 | wait["wblacklist"] = True 1977 | cl.sendText(msg.to,"send contact to ban") 1978 | 1979 | elif msg.text in ["Blacklist"]: 1980 | if msg.from_ in admin: 1981 | wait["dblacklist"] = True 1982 | cl.sendText(msg.to,"send contact to ban") 1983 | 1984 | elif msg.text in ["Banlist"]: 1985 | if msg.from_ in admin: 1986 | if wait["blacklist"] == {}: 1987 | cl.sendText(msg.to,"Nothing 􀨁􀄻double thumbs up􏿿") 1988 | else: 1989 | cl.sendText(msg.to,"Daftar Banlist􏿿") 1990 | mc = "[⎈]Blacklist [⎈]\n" 1991 | for mi_d in wait["blacklist"]: 1992 | mc += "[✗] " + cl.getContact(mi_d).displayName + " \n" 1993 | cl.sendText(msg.to, mc + "") 1994 | elif msg.text in ["Ban cek","Cekban"]: 1995 | if msg.from_ in admin: 1996 | if msg.toType == 2: 1997 | group = cl.getGroup(msg.to) 1998 | gMembMids = [contact.mid for contact in group.members] 1999 | matched_list = [] 2000 | for tag in wait["blacklist"]: 2001 | matched_list+=filter(lambda str: str == tag, gMembMids) 2002 | cocoa = "[⎈]Mid Blacklist [⎈]" 2003 | for mm in matched_list: 2004 | cocoa += "\n" + mm + "\n" 2005 | cl.sendText(msg.to,cocoa + "") 2006 | elif msg.text.lower() == 'kill': 2007 | if msg.from_ in admin: 2008 | if msg.toType == 2: 2009 | group = ki.getGroup(msg.to) 2010 | gMembMids = [contact.mid for contact in group.members] 2011 | matched_list = [] 2012 | for tag in wait["blacklist"]: 2013 | matched_list+=filter(lambda str: str == tag, gMembMids) 2014 | if matched_list == []: 2015 | ki.sendText(msg.to,"No Blacklist List") 2016 | return 2017 | for jj in matched_list: 2018 | try: 2019 | cl.kickoutFromGroup(msg.to,[jj]) 2020 | ki.kickoutFromGroup(msg.to,[jj]) 2021 | ki2.kickoutFromGroup(msg.to,[jj]) 2022 | ki3.kickoutFromGroup(msg.to,[jj]) 2023 | ki4.kickoutFromGroup(msg.to,[jj]) 2024 | ki5.kickoutFromGroup(msg.to,[jj]) 2025 | print (msg.to,[jj]) 2026 | except: 2027 | pass 2028 | elif "Nuke" in msg.text: 2029 | if msg.from_ in admin: 2030 | if msg.toType == 2: 2031 | print "ok" 2032 | _name = msg.text.replace("Nuke","") 2033 | gs = ki.getGroup(msg.to) 2034 | gs = ki2.getGroup(msg.to) 2035 | gs = ki3.getGroup(msg.to) 2036 | gs = ki4.getGroup(msg.to) 2037 | gs = ki5.getGroup(msg.to) 2038 | cl.sendText(msg.to,"Christ Mouko Sundla") 2039 | targets = [] 2040 | for g in gs.members: 2041 | if _name in g.displayName: 2042 | targets.append(g.mid) 2043 | if targets == []: 2044 | ki.sendText(msg.to,"No Member") 2045 | ki2.sendText(msg.to,"Nothing Bosqu") 2046 | else: 2047 | for target in targets: 2048 | if not target in Bots: 2049 | try: 2050 | klist=[cl,ki,ki2,ki3,ki4,ki5] 2051 | kicker=random.choice(klist) 2052 | kicker.kickoutFromGroup(msg.to,[target]) 2053 | print (msg.to,[g.mid]) 2054 | except: 2055 | ki.sendText(msg,to,"Hahaha") 2056 | ki2.sendText(msg,to,"Fakyu Sundal") 2057 | 2058 | #----------------------------------------------- 2059 | elif msg.text.lower() == ["join all"]: 2060 | G = cl.getGroup(msg.to) 2061 | ginfo = cl.getGroup(msg.to) 2062 | G.preventJoinByTicket = False 2063 | cl.updateGroup(G) 2064 | invsend = 0 2065 | Ticket = cl.reissueGroupTicket(msg.to) 2066 | ki.acceptGroupInvitationByTicket(msg.to,Ticket) 2067 | time.sleep(0.01) 2068 | ki2.acceptGroupInvitationByTicket(msg.to,Ticket) 2069 | time.sleep(0.01) 2070 | ki3.acceptGroupInvitationByTicket(msg.to,Ticket) 2071 | time.sleep(0.01) 2072 | ki4.acceptGroupInvitationByTicket(msg.to,Ticket) 2073 | time.sleep(0.01) 2074 | ki5.acceptGroupInvitationByTicket(msg.to,Ticket) 2075 | time.sleep(0.01) 2076 | G = cl.getGroup(msg.to) 2077 | ginfo = cl.getGroup(msg.to) 2078 | G.preventJoinByTicket = True 2079 | random.choice(KAC).updateGroup(G) 2080 | print "kicker ok" 2081 | G.preventJoinByTicket(G) 2082 | random.choice(KAC).updateGroup(G) 2083 | #----------------------------------------------- 2084 | elif msg.text in ["Sayang","Kuy","All join","Minna"]: 2085 | if msg.from_ in admsa: 2086 | G = cl.getGroup(msg.to) 2087 | ginfo = cl.getGroup(msg.to) 2088 | G.preventJoinByTicket = False 2089 | cl.updateGroup(G) 2090 | invsend = 0 2091 | Ticket = cl.reissueGroupTicket(msg.to) 2092 | ki.acceptGroupInvitationByTicket(msg.to,Ticket) 2093 | time.sleep(0.2) 2094 | ki2.acceptGroupInvitationByTicket(msg.to,Ticket) 2095 | time.sleep(0.2) 2096 | ki3.acceptGroupInvitationByTicket(msg.to,Ticket) 2097 | time.sleep(0.2) 2098 | ki4.acceptGroupInvitationByTicket(msg.to,Ticket) 2099 | time.sleep(0.2) 2100 | ki5.acceptGroupInvitationByTicket(msg.to,Ticket) 2101 | time.sleep(0.2) 2102 | G = cl.getGroup(msg.to) 2103 | G.preventJoinByTicket = True 2104 | ki.updateGroup(G) 2105 | print "kicker ok" 2106 | G.preventJoinByTicket(G) 2107 | ki.updateGroup(G) 2108 | 2109 | elif msg.text.lower() == 'Sp come': 2110 | G = cl.getGroup(msg.to) 2111 | ginfo = cl.getGroup(msg.to) 2112 | G.preventJoinByTicket = False 2113 | cl.updateGroup(G) 2114 | invsend = 0 2115 | Ticket = cl.reissueGroupTicket(msg.to) 2116 | ki.acceptGroupInvitationByTicket(msg.to,Ticket) 2117 | ki2.acceptGroupInvitationByTicket(msg.to,Ticket) 2118 | ki3.acceptGroupInvitationByTicket(msg.to,Ticket) 2119 | ki4.acceptGroupInvitationByTicket(msg.to,Ticket) 2120 | ki5.acceptGroupInvitationByTicket(msg.to,Ticket) 2121 | G = cl.getGroup(msg.to) 2122 | ginfo = cl.getGroup(msg.to) 2123 | G.preventJoinByTicket = True 2124 | ki.updateGroup(G) 2125 | print "kicker ok" 2126 | G.preventJoinByTicket(G) 2127 | ki.updateGroup(G) 2128 | #----------------------------------------------- 2129 | elif "Pro1 in" in msg.text: 2130 | G = cl.getGroup(msg.to) 2131 | ginfo = cl.getGroup(msg.to) 2132 | G.preventJoinByTicket = False 2133 | cl.updateGroup(G) 2134 | invsend = 0 2135 | Ticket = cl.reissueGroupTicket(msg.to) 2136 | ki.acceptGroupInvitationByTicket(msg.to,Ticket) 2137 | G = cl.getGroup(msg.to) 2138 | ginfo = cl.getGroup(msg.to) 2139 | G.preventJoinByTicket = True 2140 | ki.updateGroup(G) 2141 | print "kicker ok" 2142 | G.preventJoinByTicket(G) 2143 | ki.updateGroup(G) 2144 | #----------------------------------------------- 2145 | elif "Pro2 in" in msg.text: 2146 | G = cl.getGroup(msg.to) 2147 | ginfo = cl.getGroup(msg.to) 2148 | G.preventJoinByTicket = False 2149 | cl.updateGroup(G) 2150 | invsend = 0 2151 | Ticket = cl.reissueGroupTicket(msg.to) 2152 | ki2.acceptGroupInvitationByTicket(msg.to,Ticket) 2153 | G = cl.getGroup(msg.to) 2154 | ginfo = cl.getGroup(msg.to) 2155 | G.preventJoinByTicket = True 2156 | ki2.updateGroup(G) 2157 | print "kicker ok" 2158 | G.preventJoinByTicket(G) 2159 | ki2.updateGroup(G) 2160 | #----------------------------------------------- 2161 | elif "Pro3 in" in msg.text: 2162 | G = cl.getGroup(msg.to) 2163 | ginfo = cl.getGroup(msg.to) 2164 | G.preventJoinByTicket = False 2165 | cl.updateGroup(G) 2166 | invsend = 0 2167 | Ticket = cl.reissueGroupTicket(msg.to) 2168 | ki3.acceptGroupInvitationByTicket(msg.to,Ticket) 2169 | G = cl.getGroup(msg.to) 2170 | ginfo = cl.getGroup(msg.to) 2171 | G.preventJoinByTicket = True 2172 | ki2.updateGroup(G) 2173 | print "kicker ok" 2174 | G.preventJoinByTicket(G) 2175 | ki2.updateGroup(G) 2176 | #----------------------------------------------- 2177 | elif "Pro4 in" in msg.text: 2178 | G = cl.getGroup(msg.to) 2179 | ginfo = cl.getGroup(msg.to) 2180 | G.preventJoinByTicket = False 2181 | cl.updateGroup(G) 2182 | invsend = 0 2183 | Ticket = cl.reissueGroupTicket(msg.to) 2184 | ki4.acceptGroupInvitationByTicket(msg.to,Ticket) 2185 | G = cl.getGroup(msg.to) 2186 | ginfo = cl.getGroup(msg.to) 2187 | G.preventJoinByTicket = True 2188 | ki3.updateGroup(G) 2189 | print "kicker ok" 2190 | G.preventJoinByTicket(G) 2191 | ki3.updateGroup(G) 2192 | #----------------------------------------------- 2193 | elif "Pro5 in" in msg.text: 2194 | G = cl.getGroup(msg.to) 2195 | ginfo = cl.getGroup(msg.to) 2196 | G.preventJoinByTicket = False 2197 | cl.updateGroup(G) 2198 | invsend = 0 2199 | Ticket = cl.reissueGroupTicket(msg.to) 2200 | ki5.acceptGroupInvitationByTicket(msg.to,Ticket) 2201 | G = cl.getGroup(msg.to) 2202 | ginfo = cl.getGroup(msg.to) 2203 | G.preventJoinByTicket = True 2204 | ki5.updateGroup(G) 2205 | print "kicker ok" 2206 | G.preventJoinByTicket(G) 2207 | ki5.updateGroup(G) 2208 | #----------------------------------------------- 2209 | elif msg.text in ["See you","Dadah","Good bye","Sayonara"]: 2210 | if msg.toType == 2: 2211 | ginfo = cl.getGroup(msg.to) 2212 | try: 2213 | cl.sendText(msg.to,"Bye Bye😘 " + str(ginfo.name) + "") 2214 | ki.leaveGroup(msg.to) 2215 | ki2.leaveGroup(msg.to) 2216 | ki3.leaveGroup(msg.to) 2217 | ki4.leaveGroup(msg.to) 2218 | ki5.leaveGroup(msg.to) 2219 | except: 2220 | pass 2221 | #----------------------------------------------- 2222 | elif "Pro1 bye" in msg.text: 2223 | if msg.toType == 2: 2224 | ginfo = cl.getGroup(msg.to) 2225 | try: 2226 | ki.leaveGroup(msg.to) 2227 | except: 2228 | pass 2229 | #----------------------------------------------- 2230 | elif "Pro2 bye" in msg.text: 2231 | if msg.toType == 2: 2232 | ginfo = cl.getGroup(msg.to) 2233 | try: 2234 | ki.leaveGroup(msg.to) 2235 | except: 2236 | pass 2237 | #----------------------------------------------- 2238 | elif "Pro3 bye" in msg.text: 2239 | if msg.toType == 2: 2240 | ginfo = cl.getGroup(msg.to) 2241 | try: 2242 | ki3.leaveGroup(msg.to) 2243 | except: 2244 | pass 2245 | #----------------------------------------------- 2246 | elif "Pro4 bye" in msg.text: 2247 | if msg.toType == 2: 2248 | ginfo = cl.getGroup(msg.to) 2249 | try: 2250 | ki4.leaveGroup(msg.to) 2251 | except: 2252 | pass 2253 | #----------------------------------------------- 2254 | elif "Pro5 bye" in msg.text: 2255 | if msg.toType == 2: 2256 | ginfo = cl.getGroup(msg.to) 2257 | try: 2258 | ki5.leaveGroup(msg.to) 2259 | except: 2260 | pass 2261 | #----------------------------------------------- 2262 | elif msg.text in ["Welcome","wc","welcome","Wc"]: 2263 | ginfo = cl.getGroup(msg.to) 2264 | cl.sendText(msg.to,"Welcom to Group " + str(ginfo.name)) 2265 | cl.sendText(msg.to,"Owner Group " + str(ginfo.name) + " :\n" + ginfo.creator.displayName ) 2266 | #----------------------------------------------- 2267 | if op.type == 19: 2268 | try: 2269 | if op.param3 in mid: 2270 | if op.param2 in kimid: 2271 | G = ki.getGroup(op.param1) 2272 | G.preventJoinByTicket = False 2273 | ki.updateGroup(G) 2274 | Ticket = ki.reissueGroupTicket(op.param1) 2275 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2276 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2277 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2278 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2279 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2280 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2281 | G.preventJoinByTicket = True 2282 | cl.updateGroup(G) 2283 | else: 2284 | G = ki.getGroup(op.param1) 2285 | ki.kickoutFromGroup(op.param1,[op.param2]) 2286 | G.preventJoinByTicket = False 2287 | ki.updateGroup(G) 2288 | Ticket = ki.reissueGroupTicket(op.param1) 2289 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2290 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2291 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2292 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2293 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2294 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2295 | G.preventJoinByTicket = True 2296 | cl.updateGroup(G) 2297 | ki.updateGroup(G) 2298 | wait["blacklist"][op.param2] = True 2299 | elif op.param3 in kimid: 2300 | if op.param2 in ki2mid: 2301 | G = ki2.getGroup(op.param1) 2302 | G.preventJoinByTicket = False 2303 | ki2.updateGroup(G) 2304 | Ticket = ki2.reissueGroupTicket(op.param1) 2305 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2306 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2307 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2308 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2309 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2310 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2311 | G.preventJoinByTicket = True 2312 | ki2.updateGroup(G) 2313 | else: 2314 | G = ki2.getGroup(op.param1) 2315 | ki2.kickoutFromGroup(op.param1,[op.param2]) 2316 | G.preventJoinByTicket = False 2317 | ki2.updateGroup(G) 2318 | Ticket = ki2.reissueGroupTicket(op.param1) 2319 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2320 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2321 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2322 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2323 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2324 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2325 | G.preventJoinByTicket = True 2326 | ki.updateGroup(G) 2327 | elif op.param3 in ki3mid: 2328 | if op.param2 in ki2mid: 2329 | G = ki2.getGroup(op.param1) 2330 | G.preventJoinByTicket = False 2331 | ki2.updateGroup(G) 2332 | Ticket = ki2.reissueGroupTicket(op.param1) 2333 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2334 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2335 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2336 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2337 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2338 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2339 | G.preventJoinByTicket = True 2340 | ki2.updateGroup(G) 2341 | else: 2342 | G = cl.getGroup(op.param1) 2343 | ki2.kickoutFromGroup(op.param1,[op.param2]) 2344 | G.preventJoinByTicket = False 2345 | ki2.updateGroup(G) 2346 | Ticket = ki2.reissueGroupTicket(op.param1) 2347 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2348 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2349 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2350 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2351 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2352 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2353 | G.preventJoinByTicket = True 2354 | ki2.updateGroup(G) 2355 | 2356 | elif op.param3 in ki2mid: 2357 | if op.param2 in ki3mid: 2358 | G = ki3.getGroup(op.param1) 2359 | G.preventJoinByTicket = False 2360 | ki3.updateGroup(G) 2361 | Ticket = ki3.reissueGroupTicket(op.param1) 2362 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2363 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2364 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2365 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2366 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2367 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2368 | G.preventJoinByTicket = True 2369 | ki3.updateGroup(G) 2370 | else: 2371 | G = cl.getGroup(op.param1) 2372 | ki4.kickoutFromGroup(op.param1,[op.param2]) 2373 | G.preventJoinByTicket = False 2374 | ki4.updateGroup(G) 2375 | Ticket = ki3.reissueGroupTicket(op.param1) 2376 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2377 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2378 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2379 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2380 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2381 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2382 | G.preventJoinByTicket = True 2383 | 2384 | elif op.param3 in ki4mid: 2385 | if op.param2 in ki5mid: 2386 | G = ki5.getGroup(op.param1) 2387 | G.preventJoinByTicket = False 2388 | ki5.updateGroup(G) 2389 | Ticket = ki5.reissueGroupTicket(op.param1) 2390 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2391 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2392 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2393 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2394 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2395 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2396 | G.preventJoinByTicket = True 2397 | cl.updateGroup(G) 2398 | else: 2399 | G = ki5.getGroup(op.param1) 2400 | ki5.kickoutFromGroup(op.param1,[op.param2]) 2401 | G.preventJoinByTicket = False 2402 | ki5.updateGroup(G) 2403 | Ticket = ki5.reissueGroupTicket(op.param1) 2404 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2405 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2406 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2407 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2408 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2409 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2410 | G.preventJoinByTicket = True 2411 | ki5.updateGroup(G) 2412 | 2413 | elif op.param3 in ki5mid: 2414 | if op.param2 in ki4mid: 2415 | G = ki4.getGroup(op.param1) 2416 | G.preventJoinByTicket = False 2417 | ki4.updateGroup(G) 2418 | Ticket = ki4.reissueGroupTicket(op.param1) 2419 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2420 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2421 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2422 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2423 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2424 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2425 | G.preventJoinByTicket = True 2426 | ki4.updateGroup(G) 2427 | else: 2428 | G = ki4.getGroup(op.param1) 2429 | ki4.kickoutFromGroup(op.param1,[op.param2]) 2430 | G.preventJoinByTicket = False 2431 | ki4.updateGroup(G) 2432 | Ticket = ki4.reissueGroupTicket(op.param1) 2433 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2434 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2435 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2436 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2437 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2438 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2439 | G.preventJoinByTicket = True 2440 | ki4.updateGroup(G) 2441 | elif op.param3 in ki6mid: 2442 | if op.param2 in ki5mid: 2443 | G = ki5.getGroup(op.param1) 2444 | G.preventJoinByTicket = False 2445 | ki5.updateGroup(G) 2446 | Ticket = ki5.reissueGroupTicket(op.param1) 2447 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2448 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2449 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2450 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2451 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2452 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2453 | G.preventJoinByTicket = True 2454 | ki5.updateGroup(G) 2455 | else: 2456 | G = ki5.getGroup(op.param1) 2457 | ki5.kickoutFromGroup(op.param1,[op.param2]) 2458 | G.preventJoinByTicket = False 2459 | ki5.updateGroup(G) 2460 | Ticket = ki5.reissueGroupTicket(op.param1) 2461 | cl.acceptGroupInvitationByTicket(op.param1,Ticket) 2462 | ki.acceptGroupInvitationByTicket(op.param1,Ticket) 2463 | ki2.acceptGroupInvitationByTicket(op.param1,Ticket) 2464 | ki3.acceptGroupInvitationByTicket(op.param1,Ticket) 2465 | ki4.acceptGroupInvitationByTicket(op.param1,Ticket) 2466 | ki5.acceptGroupInvitationByTicket(op.param1,Ticket) 2467 | G.preventJoinByTicket = True 2468 | ki5.updateGroup(G) 2469 | 2470 | except: 2471 | pass 2472 | 2473 | if op.type == 17: 2474 | if op.param2 not in Bots: 2475 | if op.param2 in Bots: 2476 | pass 2477 | if wait["protect"] == True: 2478 | if wait["blacklist"][op.param2] == True: 2479 | try: 2480 | random.choice(KAC).kickoutFromGroup(op.param1,[op.param2]) 2481 | G = random.choice(KAC).getGroup(op.param1) 2482 | G.preventJoinByTicket = True 2483 | ki4.updateGroup(G) 2484 | # random.choice(KAC).kickoutFromGroup(op.param1,[op.param2]) 2485 | except: 2486 | # pass 2487 | try: 2488 | random.choice(KAC).kickoutFromGroup(op.param1,[op.param2]) 2489 | G = random.choice(KAC).getGroup(op.param1) 2490 | G.preventJoinByTicket = True 2491 | random.choice(KAC).updateGroup(G) 2492 | # random.choice(KAK).kickoutFromGroup(op.param1,[op.param2]) 2493 | except: 2494 | pass 2495 | elif op.param2 not in admin + Bots: 2496 | random.choice(KAC).sendText(op.param1,"Welcome. Don't Play Bots. I can kick you!") 2497 | else: 2498 | pass 2499 | if op.type == 19: 2500 | if op.param2 not in Bots: 2501 | if op.param2 in Bots: 2502 | pass 2503 | elif wait["protect"] == True: 2504 | wait ["blacklist"][op.param2] = True 2505 | random.choice(KAC).kickoutFromGroup(op.param1,[op.param2]) 2506 | else: 2507 | cl.sendText(op.param1,"") 2508 | else: 2509 | cl.sendText(op.param1,"") 2510 | if op.type == 13: 2511 | if op.param2 not in Bots: 2512 | if op.param2 in Bots: 2513 | pass 2514 | elif wait["inviteprotect"] == True: 2515 | wait ["blacklist"][op.param2] = True 2516 | random.choice(KAC).kickoutFromGroup(op.param1,[op.param2]) 2517 | else: 2518 | cl.sendText(op.param1,"") 2519 | else: 2520 | cl.sendText(op.param1,"") 2521 | if op.param2 not in Bots: 2522 | if op.param2 in Bots: 2523 | pass 2524 | elif wait["inviteprotect"] == True: 2525 | wait ["blacklist"][op.param2] = True 2526 | cl.cancelGroupInvitation(op.param1,[op.param3]) 2527 | else: 2528 | cl.sendText(op.param1,"") 2529 | else: 2530 | cl.sendText(op.param1,"") 2531 | if op.param2 not in Bots: 2532 | if op.param2 in Bots: 2533 | pass 2534 | elif wait["cancelprotect"] == True: 2535 | wait ["blacklist"][op.param2] = True 2536 | cl.cancelGroupInvitation(op.param1,[op.param3]) 2537 | else: 2538 | cl.sendText(op.param1,"") 2539 | else: 2540 | cl.sendText(op.param1,"") 2541 | if op.type == 11: 2542 | if op.param2 not in Bots: 2543 | if op.param2 in Bots: 2544 | pass 2545 | elif wait["linkprotect"] == True: 2546 | wait ["blacklist"][op.param2] = True 2547 | G = ki.getGroup(op.param1) 2548 | G.preventJoinByTicket = True 2549 | ki.updateGroup(G) 2550 | random.choice(KAC).kickoutFromGroup(op.param1,[op.param2]) 2551 | else: 2552 | cl.sendText(op.param1,"") 2553 | else: 2554 | cl.sendText(op.param1,"") 2555 | if op.type == 5: 2556 | if wait["autoAdd"] == True: 2557 | if (wait["message"] in [""," ","\n",None]): 2558 | pass 2559 | else: 2560 | cl.sendText(op.param1,str(wait["message"])) 2561 | 2562 | #------Open QR Kick start------# 2563 | if op.type == 11: 2564 | if wait["linkprotect"] == True: 2565 | if op.param2 not in Bots: 2566 | G = random.choice(KAC).getGroup(op.param1) 2567 | G.preventJoinByTicket = True 2568 | random.choice(KAC).kickoutFromGroup(op.param1,[op.param3]) 2569 | random.choice(KAC).updateGroup(G) 2570 | #------Open QR Kick finish-----# 2571 | #------------------------------------------------------------------------------------ 2572 | 2573 | if op.type == 55: 2574 | print "[NOTIFIED_READ_MESSAGE]" 2575 | try: 2576 | if op.param1 in wait2['readPoint']: 2577 | Nama = cl.getContact(op.param2).displayName 2578 | if Nama in wait2['readMember'][op.param1]: 2579 | pass 2580 | else: 2581 | wait2['readMember'][op.param1] += "\n|| " + Nama 2582 | wait2['ROM'][op.param1][op.param2] = "|| " + Nama 2583 | wait2['setTime'][msg.to] = datetime.strftime(now2,"%H:%M") 2584 | else: 2585 | cl.sendText 2586 | except: 2587 | pass 2588 | 2589 | if op.type == 59: 2590 | print op 2591 | 2592 | 2593 | except Exception as error: 2594 | print error 2595 | 2596 | 2597 | def a2(): 2598 | now2 = datetime.now() 2599 | nowT = datetime.strftime(now2,"%M") 2600 | if nowT[14:] in ["10","20","30","40","50","00"]: 2601 | return False 2602 | else: 2603 | return True 2604 | def nameUpdate(): 2605 | while True: 2606 | try: 2607 | #while a2(): 2608 | #pass 2609 | if wait["clock"] == True: 2610 | now2 = datetime.now() 2611 | nowT = datetime.strftime(now2,"(%H:%M)") 2612 | profile = cl.getProfile() 2613 | profile.displayName = wait["cName"] + nowT 2614 | cl.updateProfile(profile) 2615 | time.sleep(600) 2616 | except: 2617 | pass 2618 | thread2 = threading.Thread(target=nameUpdate) 2619 | thread2.daemon = True 2620 | thread2.start() 2621 | #------------------------------------------------------------------------------------------- 2622 | def autolike(): 2623 | count = 1 2624 | while True: 2625 | try: 2626 | for posts in cl.activity(1)["result"]["posts"]: 2627 | if posts["postInfo"]["liked"] is False: 2628 | if wait["likeOn"] == True: 2629 | cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) 2630 | ki.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) 2631 | ki2.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) 2632 | ki3.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) 2633 | ki4.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) 2634 | ki5.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) 2635 | print "Like" 2636 | if wait["commentOn"] == True: 2637 | if posts["userInfo"]["writerMid"] in wait["commentBlack"]: 2638 | pass 2639 | else: 2640 | cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"]) 2641 | ki.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"]) 2642 | ki2.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"]) 2643 | ki3.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"]) 2644 | ki4.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"]) 2645 | ki5.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"]) 2646 | except: 2647 | count += 1 2648 | if(count == 50): 2649 | sys.exit(0) 2650 | else: 2651 | pass 2652 | thread2 = threading.Thread(target=autolike) 2653 | thread2.daemon = True 2654 | thread2.start() 2655 | #------------------------------------------------------------------------------------------ 2656 | while True: 2657 | try: 2658 | Ops = cl.fetchOps(cl.Poll.rev, 5) 2659 | except EOFError: 2660 | raise Exception("It might be wrong revision\n" + str(cl.Poll.rev)) 2661 | 2662 | for Op in Ops: 2663 | if (Op.type != OpType.END_OF_OPERATION): 2664 | cl.Poll.rev = max(cl.Poll.rev, Op.revision) 2665 | bot(Op) 2666 | #------------------------------------------------------------------------------------------ 2667 | --------------------------------------------------------------------------------