forked from ziad69/ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZid.py
745 lines (694 loc) · 30.7 KB
/
Zid.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
# -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests
cl = LINETCR.LINE()
cl.login(qr=True)
cl.loginResult()
print "===[Login Success]==="
helpMessage ="""
┏━━━━ೋ• ❄ •ೋ━━━━━┓
¢σммαи∂ fσя вσt
┗━━━━ೋ• ❄ •ೋ━━━━━┛
❂͜͡☆➣ 『Help』
❂͜͡☆➣ 『Me』
❂͜͡☆➣ 『Gcreator』
❂͜͡☆➣ 『Leave group:』
❂͜͡☆➣ 『Cancel』
❂͜͡☆➣ 『List group:』
❂͜͡☆➣ 『Curl』
❂͜͡☆➣ 『Ourl』
❂͜͡☆➣ 『Qr:on/off』
❂͜͡☆➣ 『Gift』
❂͜͡☆➣ 『Mentionall』
❂͜͡☆➣ 『Setview』
❂͜͡☆➣ 『Kick @』 Kick By Tag
❂͜͡☆➣ 『Gn』
❂͜͡☆➣ 『Welcome』
❂͜͡☆➣ 『Bc: (text)』 Broadcast To All Group
❂͜͡☆➣ 『Cancelall』
❂͜͡☆➣ 『Gurl』
❂͜͡☆➣ 『Self Like』
❂͜͡☆➣ 『Copy @』
❂͜͡☆➣ 『Backup me』
❂͜͡☆➣ 『Ban @』
❂͜͡☆➣ 『Unban @』
❂͜͡☆➣ 『Banlist』
❂͜͡☆➣ 『Kill ban』
❂͜͡☆➣ 『Bot:restart』
❂͜͡☆➣ 『Mad』
❂͜͡☆➣ 『Guest』
❂͜͡☆➣ 『Autojoin:on/off』
❂͜͡☆➣ 『Mayhem』
❂͜͡☆➣ 『Status』
❂͜͡☆➣ 『Add all』
❂͜͡☆➣ 『Contact』
❂͜͡☆➣ 『K on/off』
❂͜͡☆➣ 『Recover』
❂͜͡☆➣ 『Remove all chat』
❂͜͡☆➣ 『Welcome』
❂͜͡☆➣ 『Status』
┏━━━━ೋ• ❄ •ೋ━━━━━┓
┗━━━━ೋ• ❄ •ೋ━━━━━┛
============================
"""
mid = cl.getProfile().mid
Creator="u0710a42a75e0a476ad687639db8c069c"
admin=[",u0710a42a75e0a476ad687639db8c069c"]
contact = cl.getProfile()
profile = cl.getProfile()
profile.displayName = contact.displayName
profile.statusMessage = contact.statusMessage
profile.pictureStatus = contact.pictureStatus
wait = {
"LeaveRoom":True,
"AutoJoin":True,
"Members":0,
"AutoCancel":False,
"AutoKick":False,
"blacklist":{},
"wblacklist":False,
"dblacklist":False,
"Qr":True,
"Timeline":True,
"Contact":True,
"lang":"JP",
"BlGroup":{}
}
def sendMessage(to, text, contentMetadata={}, contentType=0):
mes = Message()
mes.to, mes.from_ = to, profile.mid
mes.text = text
mes.contentType, mes.contentMetadata = contentType, contentMetadata
if to not in messageReq:
messageReq[to] = -1
messageReq[to] += 1
def bot(op):
try:
#--------------------END_OF_OPERATION--------------------
if op.type == 0:
return
#-------------------NOTIFIED_READ_MESSAGE----------------
if op.type == 55:
try:
group_id = op.param1
user_id=op.param2
subprocess.Popen('echo "'+ user_id+'|'+str(op.createdTime)+'" >> dataSeen/%s.txt' % group_id, shell=True, stdout=subprocess.PIPE, )
except Exception as e:
print e
#------------------NOTIFIED_INVITE_INTO_ROOM-------------
if op.type == 22:
cl.leaveRoom(op.param1)
#--------------------INVITE_INTO_ROOM--------------------
if op.type == 21:
cl.leaveRoom(op.param1)
#--------------NOTIFIED_INVITE_INTO_GROUP----------------
if mid in op.param3:
if wait["AutoJoin"] == True:
cl.acceptGroupInvitation(op.param1)
else:
cl.rejectGroupInvitation(op.param1)
else:
if wait["AutoCancel"] == True:
if op.param3 in admin:
pass
else:
cl.cancelGroupInvitation(op.param1, [op.param3])
else:
if op.param3 in wait["blacklist"]:
cl.cancelGroupInvitation(op.param1, [op.param3])
cl.sendText(op.param1, "Itu kicker jgn di invite!")
else:
pass
#------------------NOTIFIED_KICKOUT_FROM_GROUP-----------------
if op.type == 19:
if wait["AutoKick"] == True:
if op.param2 in admin:
pass
try:
cl.kickoutFromGroup(op.param1,[op.param2])
cl.inviteIntoGroup(op.param1,[op.param3])
except:
try:
cl.kickoutFromGroup(op.param1,[op.param2])
cl.inviteIntoGroup(op.param1,[op.param3])
except:
print ("client Kick regulation or Because it does not exist in the group\ngid=["+op.param1+"]\nmid=["+op.param2+"]")
if op.param2 in wait["blacklist"]:
pass
else:
if op.param2 in admin:
pass
else:
wait["blacklist"][op.param2] = True
if op.param2 in wait["blacklist"]:
pass
else:
if op.param2 in admin:
pass
else:
wait["blacklist"][op.param2] = True
#--------------------------NOTIFIED_UPDATE_GROUP---------------------
if op.type == 11:
if wait["Qr"] == True:
if op.param2 in admin:
pass
else:
cl.sendText(msg.to, "Jangan mainan QR ntr ada kicker")
else:
pass
#--------------------------SEND_MESSAGE---------------------------
if op.type == 25:
msg = op.message
#----------------------------------------------------------------------------
if msg.contentType == 13:
if wait["wblacklist"] == True:
if msg.contentMetadata["mid"] not in admin:
if msg.contentMetadata["mid"] in wait["blacklist"]:
cl.sendText(msg.to,"already")
wait["wblacklist"] = False
else:
wait["blacklist"][msg.contentMetadata["mid"]] = True
wait["wblacklist"] = False
cl.sendText(msg.to,"aded")
else:
cl.sendText(msg.to,"Admin Detected~")
elif wait["dblacklist"] == True:
if msg.contentMetadata["mid"] in wait["blacklist"]:
del wait["blacklist"][msg.contentMetadata["mid"]]
cl.sendText(msg.to,"deleted")
wait["dblacklist"] = False
else:
wait["dblacklist"] = False
cl.sendText(msg.to,"It is not in the black list")
#--------------------------------------------------------
elif wait["Contact"] == True:
msg.contentType = 0
cl.sendText(msg.to,msg.contentMetadata["mid"])
if 'displayName' in msg.contentMetadata:
contact = cl.getContact(msg.contentMetadata["mid"])
try:
cu = cl.channel.getCover(msg.contentMetadata["mid"])
except:
cu = ""
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))
else:
contact = cl.getContact(msg.contentMetadata["mid"])
try:
cu = cl.channel.getCover(msg.contentMetadata["mid"])
except:
cu = ""
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))
#--------------------------------------------------------
elif msg.text == "Ginfo":
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
gCreator = ginfo.creator.displayName
except:
gCreator = "Error"
if wait["lang"] == "JP":
if ginfo.invitee is None:
sinvitee = "0"
else:
sinvitee = str(len(ginfo.invitee))
if ginfo.preventJoinByTicket == True:
u = "close"
else:
u = "open"
cl.sendText(msg.to,"[Group name]\n" + str(ginfo.name) + "\n\n[Gid]\n" + msg.to + "\n\n[Group creator]\n" + gCreator + "\n\n[Profile status]\nhttp://dl.profile.line.naver.jp/" + ginfo.pictureStatus + "\n\nMembers:" + str(len(ginfo.members)) + "members\nPending:" + sinvitee + "people\nURL:" + u + "it is inside")
else:
cl.sendText(msg.to,"[group name]\n" + str(ginfo.name) + "\n[gid]\n" + msg.to + "\n[group creator]\n" + gCreator + "\n[profile status]\nhttp://dl.profile.line.naver.jp/" + ginfo.pictureStatus)
else:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Can not be used outside the group")
else:
cl.sendText(msg.to,"Not for use less than group")
#--------------------------------------------------------
elif msg.text is None:
return
#--------------------------------------------------------
elif msg.text in ["Me"]:
msg.contentType = 13
msg.contentMetadata = {'mid': Creator}
cl.sendMessage(msg)
cl.sendText(msg.to,"Itu Yang Bikin Bot Ini Senpai :3 Open Sewa Selfbot 40K/Bulan Contact: https://line.me/ti/p~anaichiro")
#--------------------------------------------------------
elif msg.text in ["Group creator","Gcreator","gcreator"]:
ginfo = cl.getGroup(msg.to)
gCreator = ginfo.creator.mid
msg.contentType = 13
msg.contentMetadata = {'mid': gCreator}
cl.sendMessage(msg)
cl.sendText(msg.to,"Itu Yang Buat Grup Ini")
#--------------------------------------------------------
elif msg.contentType == 16:
if wait["Timeline"] == True:
msg.contentType = 0
msg.text = "post URL\n" + msg.contentMetadata["postEndUrl"]
cl.sendText(msg.to,msg.text)
#--------------------------------------------------------
elif msg.text in ["Key","help","Help"]:
cl.sendText(msg.to,helpMessage)
#--------------------------------------------------------
elif msg.text in ["List group"]:
gid = cl.getGroupIdsJoined()
h = ""
jml = 0
for i in gid:
gn = cl.getGroup(i).name
h += "♦【%s】\n" % (gn)
jml += 1
cl.sendText(msg.to,"======[List Group]======\n"+ h +"Total group: "+str(jml))
#--------------------------------------------------------
elif "Leave group: " in msg.text:
ng = msg.text.replace("Leave group: ","")
gid = cl.getGroupIdsJoined()
for i in gid:
h = cl.getGroup(i).name
if h == ng:
cl.sendText(i,"Bye "+h+"~")
cl.leaveGroup(i)
cl.sendText(msg.to,"Success left ["+ h +"] group")
else:
pass
#--------------------------------------------------------
elif "Dosa @" in msg.text:
tanya = msg.text.replace("Dosa @","")
jawab = ("60%","70%","80%","90%","100%","Tak terhingga")
jawaban = random.choice(jawab)
cl.sendText(msg.to,"Dosanya " + tanya + "adalah " + jawaban + " Banyak banyak tobat Nak ")
#-------------------------------------------------------
elif "Pahala @" in msg.text:
tanya = msg.text.replace("Pahala @","")
jawab = ("0%","20%","40%","50%","60%","Tak ada")
jawaban = random.choice(jawab)
cl.sendText(msg.to,"Pahalanya " + tanya + "adalah " + jawaban + "\nTobatlah nak")
#--------------------------------------------------------
elif msg.text in ["cancel","Cancel"]:
if msg.toType == 2:
X = cl.getGroup(msg.to)
if X.invitee is not None:
gInviMids = [contact.mid for contact in X.invitee]
cl.cancelGroupInvitation(msg.to, gInviMids)
else:
cl.sendText(msg.to,"No one is inviting")
else:
Cl.sendText(msg.to,"Can not be used outside the group")
#--------------------------------------------------------
elif msg.text in ["Ourl","Url:on"]:
if msg.toType == 2:
X = cl.getGroup(msg.to)
X.preventJoinByTicket = False
cl.updateGroup(X)
cl.sendText(msg.to,"Url Active")
else:
cl.sendText(msg.to,"Can not be used outside the group")
#--------------------------------------------------------
elif msg.text in ["Curl","Url:off"]:
if msg.toType == 2:
X = cl.getGroup(msg.to)
X.preventJoinByTicket = True
cl.updateGroup(X)
cl.sendText(msg.to,"Url inActive")
else:
cl.sendText(msg.to,"Can not be used outside the group")
#--------------------------------------------------------
elif msg.text in ["Join on","Autojoin:on"]:
wait["AutoJoin"] = True
cl.sendText(msg.to,"AutoJoin Active")
elif msg.text in ["Join off","Autojoin:off"]:
wait["AutoJoin"] = False
cl.sendText(msg.to,"AutoJoin inActive")
#--------------------------------------------------------
elif msg.text in ["Mad on"]:
wait["AutoCancel"] = True
cl.sendText(msg.to,"Dont Cancel Group Invititaion Or Get Kicked!!!")
print wait["AutoCancel"][msg.to]
elif msg.text in ["Mad Off"]:
wait["AutoCancel"] = False
cl.sendText(msg.to,"Invitation refused turned off")
print wait["AutoCancel"][msg.to]
#--------------------------------------------------------
elif "Qr:on" in msg.text:
wait["Qr"] = True
cl.sendText(msg.to,"QR Protect Active")
elif "Qr:off" in msg.text:
wait["Qr"] = False
cl.sendText(msg.to,"Qr Protect inActive")
#--------------------------------------------------------
elif "Guest on" in msg.text:
wait["AutoKick"] = True
cl.sendText(msg.to,"Dont Kick Anyone Or Get Kicked")
elif "Guest off" in msg.text:
wait["AutoKick"] = False
cl.sendText(msg.to,"AutoKick inActive")
#--------------------------------------------------------
elif msg.text in ["K on","Contact:on"]:
wait["Contact"] = True
cl.sendText(msg.to,"Contact Active")
elif msg.text in ["K off","Contact:off"]:
wait["Contact"] = False
cl.sendText(msg.to,"Contact inActive")
#--------------------------------------------------------
elif msg.text in ["Status"]:
md = ""
if wait["AutoJoin"] == True: md+="✦ Auto join : on\n"
else: md +="✦ Auto join : off\n"
if wait["Contact"] == True: md+="✦ Info Contact : on\n"
else: md+="✦ Info Contact : off\n"
if wait["AutoCancel"] == True:md+="✦ Auto cancel : on\n"
else: md+= "✦ Auto cancel : off\n"
if wait["Qr"] == True: md+="✦ Qr Protect : on\n"
else:md+="✦ Qr Protect : off\n"
if wait["AutoKick"] == True: md+="✦ Autokick : on\n"
else:md+="✦ Autokick : off"
cl.sendText(msg.to,"=====[Status]=====\n"+md)
#--------------------------------------------------------
elif msg.text in ["Gift","gift"]:
msg.contentType = 9
msg.contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58',
'PRDTYPE': 'THEME',
'MSGTPL': '5'}
msg.text = None
cl.sendMessage(msg)
elif msg.text in ["Gift1"]:
msg.contentType = 9
msg.contentMetadata={'PRDID': '696d7046-843b-4ed0-8aac-3113ed6c0733',
'PRDTYPE': 'THEME',
'MSGTPL': '6'}
msg.text = None
cl.sendMessage(msg)
elif msg.text in ["Gift2"]:
msg.contentType = 9
msg.contentMetadata={'PRDID': '8fe8cdab-96f3-4f84-95f1-6d731f0e273e',
'PRDTYPE': 'THEME',
'MSGTPL': '7'}
msg.text = None
cl.sendMessage(msg)
elif msg.text in ["Gift3"]:
msg.contentType = 9
msg.contentMetadata={'PRDID': 'ae3d9165-fab2-4e70-859b-c14a9d4137c4',
'PRDTYPE': 'THEME',
'MSGTPL': '8'}
msg.text = None
cl.sendMessage(msg)
#--------------------------------------------------------
elif msg.text in ["Tagall"]:
group = cl.getGroup(msg.to)
mem = [contact.mid for contact in group.members]
for mm in mem:
xname = cl.getContact(mm).displayName
xlen = str(len(xname)+1)
msg.contentType = 0
msg.text = "@"+xname+" "
msg.contentMetadata = {'MENTION':'{"MENTIONEES":[{"S":"0","E":'+json.dumps(xlen)+',"M":'+json.dumps(mm)+'}]}','EMTVER':'4'}
try:
cl.sendMessage(msg)
except Exception as e:
print str(e)
#--------------------------CEK SIDER------------------------------
elif "Setview" in msg.text:
subprocess.Popen("echo '' > dataSeen/"+msg.to+".txt", shell=True, stdout=subprocess.PIPE)
cl.sendText(msg.to, "Siapa Siders Hayoo 👀👀")
print "@setview"
elif "Sider" in msg.text:
lurkGroup = ""
dataResult, timeSeen, contacts, userList, timelist, recheckData = [], [], [], [], [], []
with open('dataSeen/'+msg.to+'.txt','r') as rr:
contactArr = rr.readlines()
for v in xrange(len(contactArr) -1,0,-1):
num = re.sub(r'\n', "", contactArr[v])
contacts.append(num)
pass
contacts = list(set(contacts))
for z in range(len(contacts)):
arg = contacts[z].split('|')
userList.append(arg[0])
timelist.append(arg[1])
uL = list(set(userList))
for ll in range(len(uL)):
try:
getIndexUser = userList.index(uL[ll])
timeSeen.append(time.strftime("%H:%M:%S", time.localtime(int(timelist[getIndexUser]) / 1000)))
recheckData.append(userList[getIndexUser])
except IndexError:
conName.append('nones')
pass
contactId = cl.getContacts(recheckData)
for v in range(len(recheckData)):
dataResult.append(contactId[v].displayName + ' ('+timeSeen[v]+')')
pass
if len(dataResult) > 0:
tukang = "List Viewer👀👀\n*"
grp = '\n* '.join(str(f) for f in dataResult)
total = '\n\nTotal %i viewers (%s)' % (len(dataResult), datetime.now().strftime('%H:%M:%S') )
cl.sendText(msg.to, "%s %s %s" % (tukang, grp, total))
else:
cl.sendText(msg.to, "Belum ada viewers")
print "@viewseen"
#--------------------------------------------------------
#KICK_BY_TAG
elif "Kick " in msg.text:
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', msg.text)
mention = ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
print mentionees
for mention in mentionees:
cl.kickoutFromGroup(msg.to,[mention['M']])
#--------------------------------------------------------
elif "Add all" in msg.text:
thisgroup = cl.getGroups([msg.to])
Mids = [contact.mid for contact in thisgroup[0].members]
mi_d = Mids[:33]
cl.findAndAddContactsByMids(mi_d)
cl.sendText(msg.to,"Success Add all")
#--------------------------------------------------------
elif "Recover" in msg.text:
thisgroup = cl.getGroups([msg.to])
Mids = [contact.mid for contact in thisgroup[0].members]
mi_d = Mids[:33]
cl.createGroup("Recover", mi_d)
cl.sendText(msg.to,"Success recover")
#--------------------------------------------------------
elif msg.text in ["Remove all chat"]:
cl.removeAllMessages(op.param2)
cl.sendText(msg.to,"Removed all chat")
#--------------------------------------------------------
elif ("Gn: " in msg.text):
if msg.toType == 2:
X = cl.getGroup(msg.to)
X.name = msg.text.replace("Gn: ","")
cl.updateGroup(X)
else:
cl.sendText(msg.to,"It can't be used besides the group.")
#--------------------------------------------------------
elif "VK: " in msg.text:
midd = msg.text.replace("Kick: ","")
if midd not in admin:
cl.kickoutFromGroup(msg.to,[midd])
else:
cl.sendText(msg.to,"Admin Detected")
#--------------------------------------------------------
elif "Invite: " in msg.text:
midd = msg.text.replace("Invite: ","")
cl.findAndAddContactsByMid(midd)
cl.inviteIntoGroup(msg.to,[midd])
#--------------------------------------------------------
elif msg.text in ["#welcome","Welcome","welcome","Welkam","welkam"]:
gs = cl.getGroup(msg.to)
cl.sendText(msg.to,"Senpai, Selamat Datang Di "+ gs.name)
#--------------------------------------------------------
elif "Bc: " in msg.text:
bc = msg.text.replace("Bc: ","")
gid = cl.getGroupIdsJoined()
for i in gid:
cl.sendText(i,"=======[BROADCAST]=======\n\n"+bc+"\n\nContact Me : line.me/ti/p/~anaichiro")
cl.sendText(msg.to,"Success BC BosQ")
#--------------------------------------------------------
elif msg.text in ["Cancelall"]:
gid = cl.getGroupIdsInvited()
for i in gid:
cl.rejectGroupInvitation(i)
cl.sendText(msg.to,"All invitations have been refused")
#--------------------------------------------------------
elif msg.text in ["Gurl"]:
if msg.toType == 2:
x = cl.getGroup(msg.to)
if x.preventJoinByTicket == True:
x.preventJoinByTicket = False
cl.updateGroup(x)
gurl = cl.reissueGroupTicket(msg.to)
cl.sendText(msg.to,"line://ti/g/" + gurl)
else:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Can't be used outside the group")
else:
cl.sendText(msg.to,"Not for use less than group")
#--------------------------------------------------------
elif msg.text in ["Self Like"]:
try:
print "activity"
url = cl.activity(limit=1)
print url
cl.like(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], likeType=1001)
cl.comment(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], "Auto Like By ZiAd\nMy Creator : https://line.me/ti/p/~anaichiro \n1K Folls Ig Only 20K Minat? PC Aja")
cl.sendText(msg.to, "Success~")
except Exception as E:
try:
cl.sendText(msg.to,str(E))
except:
pass
#--------------------------------------------------------
elif msg.text in ["Sp","Speed","speed"]:
start = time.time()
cl.sendText(msg.to, "『Wait Senpai ≧∀≦』")
elapsed_time = time.time() - start
cl.sendText(msg.to, "『%sseconds』" % (elapsed_time))
#--------------------------------------------------------
elif msg.text in ["Ban"]:
wait["wblacklist"] = True
cl.sendText(msg.to,"send contact")
elif msg.text in ["Unban"]:
wait["dblacklist"] = True
cl.sendText(msg.to,"send contact")
#--------------------------------------------------------
elif "Backup me" in msg.text:
try:
cl.updateDisplayPicture(profile.pictureStatus)
cl.updateProfile(profile)
cl.sendText(msg.to, "Success backup profile")
except Exception as e:
cl.sendText(msg.to, str(e))
#--------------------------------------------------------
elif "Copy " in msg.text:
copy0 = msg.text.replace("Copy ","")
copy1 = copy0.lstrip()
copy2 = copy1.replace("@","")
copy3 = copy2.rstrip()
_name = copy3
group = cl.getGroup(msg.to)
for contact in group.members:
cname = cl.getContact(contact.mid).displayName
if cname == _name:
cl.CloneContactProfile(contact.mid)
cl.sendText(msg.to, "Success~")
else:
pass
#--------------------------------------------------------
elif "Ban @" in msg.text:
if msg.toType == 2:
print "@Ban by mention"
_name = msg.text.replace("Ban @","")
_nametarget = _name.rstrip(' ')
gs = cl.getGroup(msg.to)
targets = []
for g in gs.members:
if _nametarget == g.displayName:
targets.append(g.mid)
if targets == []:
cl.sendText(msg.to,"Not found")
else:
for target in targets:
if target not in admin:
try:
wait["blacklist"][target] = True
f=codecs.open('st2__b.json','w','utf-8')
json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False)
cl.sendText(msg.to,"Succes BosQ")
except:
cl.sendText(msg.to,"Error")
else:
cl.sendText(msg.to,"Admin Detected~")
#--------------------------------------------------------
elif msg.text in ["Banlist"]:
if wait["blacklist"] == {}:
cl.sendText(msg.to,"nothing")
else:
mc = ""
for mi_d in wait["blacklist"]:
mc += "->" +cl.getContact(mi_d).displayName + "\n"
cl.sendText(msg.to,"===[Blacklist User]===\n"+mc)
#--------------------------------------------------------
elif "Unban @" in msg.text:
if msg.toType == 2:
print "@Unban by mention"
_name = msg.text.replace("Unban @","")
_nametarget = _name.rstrip(' ')
gs = cl.getGroup(msg.to)
targets = []
for g in gs.members:
if _nametarget == g.displayName:
targets.append(g.mid)
if targets == []:
cl.sendText(msg.to,"Not found")
else:
for target in targets:
try:
del wait["blacklist"][target]
f=codecs.open('st2__b.json','w','utf-8')
json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False)
cl.sendText(msg.to,"Succes BosQ")
except:
cl.sendText(msg.to,"Succes BosQ")
#--------------------------------------------------------
elif msg.text in ["Kill ban"]:
if msg.toType == 2:
group = cl.getGroup(msg.to)
gMembMids = [contact.mid for contact in group.members]
matched_list = []
for tag in wait["blacklist"]:
matched_list+=filter(lambda str: str == tag, gMembMids)
if matched_list == []:
cl.sendText(msg.to,"There was no blacklist user")
return
for jj in matched_list:
cl.kickoutFromGroup(msg.to,[jj])
cl.sendText(msg.to,"Maaf Ya Senpai :3")
#--------------------------------------------------------
# elif "Mayhem" in msg.text:
# if msg.toType == 2:
# print "Kick all member"
# _name = msg.text.replace("Mayhem","")
# gs = cl.getGroup(msg.to)
# cl.sendText(msg.to,"Dadaaah~")
# targets = []
# for g in gs.members:
# if _name in g.displayName:
# targets.append(g.mid)
# if targets == []:
# cl.sendText(msg.to,"Not found.")
# else:
# for target in targets:
# if target not in admin:
# try:
# cl.kickoutFromGroup(msg.to,[target])
# print (msg.to,[g.mid])
# except Exception as e:
# cl.sendText(msg.to,str(e))
# cl.inviteIntoGroup(msg.to, targets)
#--------------------------------------------------------
#Restart_Program
elif msg.text in ["Bot:restart"]:
cl.sendText(msg.to, "Bot has been restarted")
restart_program()
print "@Restart"
#--------------------------------------------------------
if op.type == 59:
print op
except Exception as error:
print error
#thread2 = threading.Thread(target=nameUpdate)
#thread2.daemon = True
#thread2.start()
while True:
try:
Ops = cl.fetchOps(cl.Poll.rev, 5)
except EOFError:
raise Exception("It might be wrong revision\n" + str(cl.Poll.rev))
for Op in Ops:
if (Op.type != OpType.END_OF_OPERATION):
cl.Poll.rev = max(cl.Poll.rev, Op.revision)
bot(Op)