-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmih.py
3444 lines (3279 loc) · 160 KB
/
mih.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
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
import KRIS
from KRIS.lib.curve.ttypes import *
from datetime import datetime
import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile
from bs4 import BeautifulSoup
from urllib import urlopen
import requests
from io import StringIO
from threading import Thread
#from gtts import gTTS
from googletrans import Translator
kr = KRIS.LINE()
#kr.login(qr=True)
kr.login(token=""Eoxm4pBxAF7Q476P3z1a.eSx8MBEObAntrYRMbUil2G.p20z2l/I7XHYvdIRomPZdNSxYaHKxCfTbkvB4cwWy2s=")
kr.loginResult()
print "╠══TeamBotAdhi══╠"
reload(sys)
sys.setdefaultencoding('utf-8')
helpmsg =""" ╠══TeamBotAdhi══╠
╠═════════════
owner : ༺T-B-A༻ �
╠═════════════
google (text)
playstore (text)
instagram (username)
wikipedia (text)
idline (text)
time
image (text)
runtime
Restart
lirik (text)
Cancel on/off
Simisimi:on/off
Read on/off
Getinfo @
Getcontact @
Cium @
speed
Friendlist
keyset
keygrup
mode on/off
protect on/off
qr on/off
invite on/off
cancel on/off
Me
Myname:
Mybio:
Mypict
Mycover
My copy @
My backup
Getgroup image
Getmid @
Getprofile @
Getinfo @
Getname @
Getbio @
Getpict @
Getcover @
nah (Mention)
cctv on/off (Lurking)
intip/toong (Lurkers)
Micadd @
Micdel @
Mimic on/off
Miclist
╔═════════════
╔═════════════
╠owner : ༺T-B-A༻ �
╠line://ti/p/~jkp4678
╚═════════════"""
helpset ="""╠══TeamBotAdhi══╠
╔═════════════
║║ Owner : ༺T-B-A༻
║╔════════════
contact on/off
autojoin on/off
auto leave on/off
autoadd on/off
like friend
link on
respon on/off
read on/off
simisimi on/off
Sambut on/off
Pergi on/off
Respontag on/off
Kicktag on/off
╠═════════════
╠Creator: ༺T-B-A༻ �
╠line://ti/p/~jkp4678
╚═════════════"""
helpgrup ="""
╔═════════════
╠╠══TeamBotAdhi══╠
║line://ti/p/~jkp4678
║ Owner : ༺T-B-A༻ �
╠═════════════
Link on
Url
Cancel
Gcreator
Kick @
Cium @
Gname:
Gbroadcast:
Cbroadcast:
Infogrup
Gruplist
Friendlist
Blacklist
Ban @
Unban @
Clearban
Banlist
Contact ban
Midban
╠═════════════╠
Id@en
En@id
Id@jp
Jp@id
Id@th
Th@id
Id@ar
Ar@id
Id@ko
Ko@id
Say-id
Say-en
Say-jp
╠════════════
╠══TeamBotAdhi══╠
╠owner : ༺T-B-A༻ �
╠Creator by : ༺T-B-A༻ �
╠line://ti/p/~jkp4678
╚═════════════"""
KAC=[kr]
mid = kr.getProfile().mid
Bots=[mid]
admin=["u12c5fc99b7a805a353472ae606e20bda","u350cc7408cc6cc82e056ee046131f925",mid]
wait = {
"likeOn":False,
"alwayRead":False,
"detectMention":True,
"kickMention":False,
"steal":True,
'pap':{},
'invite':{},
"spam":{},
'contact':False,
'autoJoin':True,
'autoCancel':{"on":False,"members":1},
'leaveRoom':True,
'timeline':False,
'autoAdd':True,
'message':"""Tanks For You add kak""",
"lang":"JP",
"comment":"👉ąµţ๏ℓɨЌ€ 😊\n\n☆º°╠══TeamBotAdhi═)═_^ω^)\n╠══TeamBotAdhi══╠\n👈://line.me/ti/p/~jkp4678 «««",
"commentOn":False,
"commentBlack":{},
"wblack":False,
"dblack":False,
"clock":False,
"cNames":"",
"cNames":"",
"Wc":False,
"Lv":False,
'MENTION':True,
"blacklist":{},
"wblacklist":False,
"dblacklist":False,
"protect":False,
"cancelprotect":False,
"inviteprotect":False,
"linkprotect":False,
}
wait2 = {
"readPoint":{},
"readMember":{},
"setTime":{},
"ROM":{}
}
mimic = {
"copy":False,
"copy2":False,
"status":False,
"target":{}
}
settings = {
"simiSimi":{}
}
res = {
'num':{},
'us':{},
'au':{},
}
setTime = {}
setTime = wait2['setTime']
mulai = time.time()
contact = kr.getProfile()
backup = kr.getProfile()
backup.displayName = contact.displayName
backup.statusMessage = contact.statusMessage
backup.pictureStatus = contact.pictureStatus
def restart_program():
python = sys.executable
os.execl(python, python, * sys.argv)
def download_page(url):
version = (3,0)
cur_version = sys.version_info
if cur_version >= version: #If the Current Version of Python is 3.0 or above
import urllib,request #urllib library for Extracting web pages
try:
headers = {}
headers['User-Agent'] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
req = urllib,request.Request(url, headers = headers)
resp = urllib,request.urlopen(req)
respData = str(resp.read())
return respData
except Exception as e:
print(str(e))
else: #If the Current Version of Python is 2.x
import urllib2
try:
headers = {}
headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17"
req = urllib2.Request(url, headers = headers)
response = urllib2.urlopen(req)
page = response.read()
return page
except:
return"Page Not found"
#Finding 'Next Image' from the given raw page
def _images_get_next_item(s):
start_line = s.find('rg_di')
if start_line == -1: #If no links are found then give an error!
end_quote = 0
link = "no_links"
return link, end_quote
else:
start_line = s.find('"class="rg_meta"')
start_content = s.find('"ou"',start_line+90)
end_content = s.find(',"ow"',start_content-90)
content_raw = str(s[start_content+6:end_content-1])
return content_raw, end_content
def sendAudioWithURL(self, to_, url):
path = '%s/pythonLine-%i.data' % (tempfile.gettempdir(), randint(0, 9))
r = requests.get(url, stream=True)
if r.status_code == 200:
with open(path, 'w') as f:
shutil.copyfileobj(r.raw, f)
else:
raise Exception('Download audio failure.')
try:
self.sendAudio(to_, path)
except Exception as e:
raise e
#Getting all links with the help of '_images_get_next_image'
def _images_get_all_items(page):
items = []
while True:
item, end_content = _images_get_next_item(page)
if item == "no_links":
break
else:
items.append(item) #Append all the links in the list named 'Links'
time.sleep(0.1) #Timer could be used to slow down the request for image downloads
page = page[end_content:]
return items
def download_page(url):
version = (3,0)
cur_version = sys.version_info
if cur_version >= version: #If the Current Version of Python is 3.0 or above
import urllib,request #urllib library for Extracting web pages
try:
headers = {}
headers['User-Agent'] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
req = urllib,request.Request(url, headers = headers)
resp = urllib,request.urlopen(req)
respData = str(resp.read())
return respData
except Exception as e:
print(str(e))
else: #If the Current Version of Python is 2.x
import urllib2
try:
headers = {}
headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17"
req = urllib2.Request(url, headers = headers)
response = urllib2.urlopen(req)
page = response.read()
return page
except:
return"Page Not found"
def upload_tempimage(client):
'''
Upload a picture of a kitten. We don't ship one, so get creative!
'''
config = {
'album': album,
'name': 'bot auto upload',
'title': 'bot auto upload',
'description': 'bot auto upload'
}
print("Uploading image... ")
image = client.upload_from_path(image_path, config=config, anon=False)
print("Done")
print()
def summon(to, nama):
aa = ""
bb = ""
strt = int(14)
akh = int(14)
nm = nama
for mm in nm:
akh = akh + 2
aa += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(mm)+"},"""
strt = strt + 6
akh = akh + 4
bb += "\xe2\x95\xa0 @x \n"
aa = (aa[:int(len(aa)-1)])
msg = Message()
msg.to = to
msg.text = "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\n"+bb+"\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90"
msg.contentMetadata ={'MENTION':'{"MENTIONEES":['+aa+']}','EMTVER':'4'}
print "[Command] Tag All"
try:
kr.sendMessage(msg)
except Exception as error:
print error
def waktu(secs):
mins, secs = divmod(secs,60)
hours, mins = divmod(mins,60)
return '%02d Jam %02d Menit %02d Detik' % (hours, mins, secs)
def cms(string, commands): #/XXX, >XXX, ;XXX, ^XXX, %XXX, $XXX...
tex = ["+","@","/",">",";","^","%","$","^","サテラ:","サテラ:","サテラ:","サテラ:"]
for texX in tex:
for command in commands:
if string ==command:
return True
return False
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:
if op.type == 0:
return
if op.type == 5:
if wait["autoAdd"] == True:
kr.findAndAddContactsByMid(op.param1)
if (wait["message"] in [""," ","\n",None]):
pass
else:
kr.sendText(op.param1,str(wait["message"]))
if op.type == 25:
msg = op.message
if msg.from_ in mimic["target"] and mimic["status"] == True and mimic["target"][msg.from_] == True:
text = msg.text
if text is not None:
kr.sendText(msg.to,text)
if op.type == 13:
print op.param3
if op.param3 in mid:
if op.param2 in admin:
kr.acceptGroupInvitation(op.param1)
if op.type == 13:
if mid in op.param3:
if wait["autoJoin"] == True:
if op.param2 in Bots or admin:
kr.acceptGroupInvitation(op.param1)
else:
kr.rejectGroupInvitation(op.param1)
else:
print "autoJoin is Off"
if op.type == 19:
if op.param3 in admin:
kr.kickoutFromGroup(op.param1,[op.param2])
kr.inviteIntoGroup(op.param1,admin)
kr.inviteIntoGroup(op.param1,[op.param3])
else:
pass
if op.type == 19:
if mid in op.param3:
wait["blacklist"][op.param2] = True
if op.type == 22:
if wait["leaveRoom"] == True:
kr.leaveRoom(op.param1)
if op.type == 24:
if wait["leaveRoom"] == True:
kr.leaveRoom(op.param1)
if op.type == 25:
msg = op.message
if msg.toType == 0:
msg.to = msg.from_
if msg.from_ == mid:
if "join:" in msg.text:
list_ = msg.text.split(":")
try:
kr.acceptGroupInvitationByTicket(list_[1],list_[2])
G = kr.getGroup(list_[1])
G.preventJoinByTicket = True
kr.updateGroup(G)
except:
kr.sendText(msg.to,"error")
if msg.toType == 1:
if wait["leaveRoom"] == True:
kr.leaveRoom(msg.to)
if msg.contentType == 16:
url = msg.contentMetadata["postEndUrl"]
kr.like(url[25:58], url[66:], likeType=1001)
if op.type == 25:
msg = op.message
if msg.from_ in mimic["target"] and mimic["status"] == True and mimic["target"][msg.from_] == True:
text = msg.text
if text is not None:
kr.sendText(msg.to,text)
if op.type == 26:
msg = op.message
if msg.to in settings["simiSimi"]:
if settings["simiSimi"][msg.to] == True:
if msg.text is not None:
text = msg.text
r = requests.get("http://api.ntcorp.us/chatbot/v1/?text=" + text.replace(" ","+") + "&key=beta1.nt")
data = r.text
data = json.loads(data)
if data['status'] == 200:
if data['result']['result'] == 100:
kr.sendText(msg.to, "[From Simi]\n" + data['result']['response'].encode('utf-8'))
if 'MENTION' in msg.contentMetadata.keys() != None:
if wait["detectMention"] == True:
contact = kr.getContact(msg.from_)
cName = contact.displayName
balas = ["Don't Tag Me! iam Bussy!, ",cName + "Ada perlu apa, ?",cName + " pc aja klo urgent! sedang sibuk,", "kenapa, ", cName + " kangen?","kangen bilang gak usah tag tag, " + cName, "knp?, " + cName, "apasi?, " + cName + "?", "pulang gih, " + cName + "?","ada apa lo jones , ?" + cName + "Tersangkut -_-"]
ret_ = "." + random.choice(balas)
name = re.findall(r'@(\w+)', msg.text)
mention = ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
for mention in mentionees:
if mention['M'] in Bots:
kr.sendText(msg.to,ret_)
break
if 'MENTION' in msg.contentMetadata.keys() != None:
if wait["kickMention"] == True:
contact = kr.getContact(msg.from_)
cName = contact.displayName
balas = ["Dont Tag Me!! Im Busy, ",cName + " Ngapain Ngetag?, ",cName + " Nggak Usah Tag-Tag! Kalo Penting Langsung Pc Aja, ", "-_-, ","Adhi lagi off, ", cName + " Kenapa Tag saya?, ","SPAM PC aja, " + cName, "Jangan Suka Tag gua, " + cName, "Kamu siapa, " + cName + "?", "Ada Perlu apa, " + cName + "?","Tag doang tidak perlu., "]
ret_ = "[Auto Respond] " + random.choice(balas)
name = re.findall(r'@(\w+)', msg.text)
mention = ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
for mention in mentionees:
if mention['M'] in Bots:
kr.sendText(msg.to,ret_)
kr.kickoutFromGroup(msg.to,[msg.from_])
break
if msg.contentType == 13:
if wait['invite'] == True:
_name = msg.contentMetadata["displayName"]
invite = msg.contentMetadata["mid"]
groups = kr.getGroup(msg.to)
pending = groups.invitee
targets = []
for s in groups.members:
if _name in s.displayName:
kr.sendText(msg.to, _name + " Berada DiGrup Ini")
else:
targets.append(invite)
if targets == []:
pass
else:
for target in targets:
try:
kr.findAndAddContactsByMid(target)
kr.inviteIntoGroup(msg.to,[target])
kr.sendText(msg.to,"Invite " + _name)
wait['invite'] = False
break
except:
kr.sendText(msg.to,"Error")
wait['invite'] = False
break
#if msg.contentType == 13:
# if wait["steal"] == True:
# _name = msg.contentMetadata["displayName"]
# copy = msg.contentMetadata["mid"]
# groups = kr.getGroup(msg.to)
# pending = groups.invitee
# targets = []
# for s in groups.members:
# if _name in s.displayName:
# print "[Target] Stealed"
# break
# else:
# targets.append(copy)
# if targets == []:
# pass
# else:
# for target in targets:
# try:
# kr.findAndAddContactsByMid(target)
# contact = kr.getContact(target)
# cu = kr.channel.getCover(target)
# path = str(cu)
# image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus
# kr.sendText(msg.to,"Nama :\n" + contact.displayName + "\n\nMid :\n" + msg.contentMetadata["mid"] + "\n\nBio :\n" + contact.statusMessage)
# kr.sendText(msg.to,"Profile Picture " + contact.displayName)
# kr.sendImageWithURL(msg.to,image)
# kr.sendText(msg.to,"Cover " + contact.displayName)
# kr.sendImageWithURL(msg.to,path)
# wait["steal"] = False
# break
# except:
# pass
if wait["alwayRead"] == True:
if msg.toType == 0:
kr.sendChatChecked(msg.from_,msg.id)
else:
kr.sendChatChecked(msg.to,msg.id)
if op.type == 25:
msg = op.message
if msg.contentType == 13:
if wait["wblack"] == True:
if msg.contentMetadata["mid"] in wait["commentBlack"]:
kr.sendText(msg.to,"In Blacklist")
wait["wblack"] = False
else:
wait["commentBlack"][msg.contentMetadata["mid"]] = True
wait["wblack"] = False
kr.sendText(msg.to,"Nothing")
elif wait["dblack"] == True:
if msg.contentMetadata["mid"] in wait["commentBlack"]:
del wait["commentBlack"][msg.contentMetadata["mid"]]
kr.sendText(msg.to,"Done")
wait["dblack"] = False
else:
wait["dblack"] = False
kr.sendText(msg.to,"Not in Blacklist")
elif wait["wblacklist"] == True:
if msg.contentMetadata["mid"] in wait["blacklist"]:
kr.sendText(msg.to,"In Blacklist")
wait["wblacklist"] = False
else:
wait["blacklist"][msg.contentMetadata["mid"]] = True
wait["wblacklist"] = False
kr.sendText(msg.to,"Done")
elif wait["dblacklist"] == True:
if msg.contentMetadata["mid"] in wait["blacklist"]:
del wait["blacklist"][msg.contentMetadata["mid"]]
kr.sendText(msg.to,"Done")
wait["dblacklist"] = False
else:
wait["dblacklist"] = False
kr.sendText(msg.to,"Done")
elif wait["contact"] == True:
msg.contentType = 0
kr.sendText(msg.to,msg.contentMetadata["mid"])
if 'displayName' in msg.contentMetadata:
contact = kr.getContact(msg.contentMetadata["mid"])
try:
cu = kr.channel.getCover(msg.contentMetadata["mid"])
except:
cu = ""
kr.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 = kr.getContact(msg.contentMetadata["mid"])
try:
cu = kr.channel.getCover(msg.contentMetadata["mid"])
except:
cu = ""
kr.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.contentType == 16:
if wait["timeline"] == True:
msg.contentType = 0
if wait["lang"] == "JP":
msg.text = "menempatkan URL\n" + msg.contentMetadata["postEndUrl"]
else:
msg.text = msg.contentMetadata["postEndUrl"]
kr.sendText(msg.to,msg.text)
elif msg.text is None:
return
elif msg.text.lower() == 'help':
if wait["lang"] == "JP":
kr.sendText(msg.to,helpmsg)
else:
kr.sendText(msg.to,helpmsg)
elif msg.text.lower() == 'keyset':
if wait["lang"] == "JP":
kr.sendText(msg.to,helpset)
else:
kr.sendText(msg.to,helpset)
elif msg.text.lower() == 'keygrup':
if wait["lang"] == "JP":
kr.sendText(msg.to,helpgrup)
else:
kr.sendText(msg.to,helpgrup)
# elif msg.text.lower() == 'keyself':
# if wait["lang"] == "JP":
# kr.sendText(msg.to,helpself)
# else:
# kr.sendText(msg.to,helpself)
# elif msg.text.lower() == 'keygrup':
# if wait["lang"] == "JP":
# kr.sendText(msg.to,helpgrup)
# else:
# kr.sendText(msg.to,helpgrup)
# elif msg.text.lower() == 'keyset':
# if wait["lang"] == "JP":
# kr.sendText(msg.to,helpset)
# else:
# kr.sendText(msg.to,helpset)
# elif msg.text.lower() == 'keytran':
# if wait["lang"] == "JP":
# kr.sendText(msg.to,helptranslate)
# else:
# kr.sendText(msg.to,helptranslate)
elif msg.text in ["Sp","Speed","speed"]:
start = time.time()
kr.sendText(msg.to, "❂➣Proses.....")
elapsed_time = time.time() - start
kr.sendText(msg.to, "%sseconds" % (elapsed_time))
elif msg.text.lower() == 'crash':
msg.contentType = 13
msg.contentMetadata = {'mid': "u12c5fc99b7a805a353472ae606e20bda',"}
kr.sendMessage(msg)
kr.sendMessage(msg)
elif msg.text.lower() == 'me':
msg.contentType = 13
msg.contentMetadata = {'mid': mid}
kr.sendMessage(msg)
elif ".fb" in msg.text:
a = msg.text.replace(".fb","")
b = urllib.quote(a)
kr.sendText(msg.to,"「 Mencari 」\n" "Type:Mencari Info\nStatus: Proses")
kr.sendText(msg.to, "https://www.facebook.com" + b)
kr.sendText(msg.to,"「 Mencari 」\n" "Type:Mencari Info\nStatus: Sukses")
#======================== FOR COMMAND MODE ON STARTING ==========================#
elif msg.text.lower() == 'mode on':
if wait["protect"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protecion Already On")
else:
kr.sendText(msg.to,"Protecion Already On")
else:
wait["protect"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protecion Already On")
else:
kr.sendText(msg.to,"Protecion Already On")
if wait["linkprotect"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Qr already On")
else:
kr.sendText(msg.to,"Protection Qr already On")
else:
wait["linkprotect"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Qr already On")
else:
kr.sendText(msg.to,"Protection Qr already On")
if wait["inviteprotect"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Invite already On")
else:
kr.sendText(msg.to,"Protection Invite already On")
else:
wait["inviteprotect"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"ρяσтє¢тισи ιиνιтє ѕєт тσ σи")
else:
kr.sendText(msg.to,"ρяσтє¢тισи ιиνιтє αℓяєα∂у σи")
if wait["cancelprotect"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"¢αи¢єℓ ρяσтє¢тισи ѕєт тσ σи")
else:
kr.sendText(msg.to,"¢αи¢єℓ ρяσтє¢тισи αℓяєα∂у σи")
else:
wait["cancelprotect"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"¢αи¢єℓ ρяσтє¢тισи ѕєт тσ σи")
else:
kr.sendText(msg.to,"¢αи¢єℓ ρяσтє¢тισи αℓяєα∂у σи")
#======================== FOR COMMAND MODE OFF STARTING ==========================#
elif msg.text.lower() == 'mode off':
if wait["protect"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection already Off")
else:
kr.sendText(msg.to,"Protection already Off")
else:
wait["protect"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"ρяσтє¢тισи ѕєт тσ σff")
else:
kr.sendText(msg.to,"ρяσтє¢тισи αℓяєα∂у σff")
if wait["linkprotect"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Qr already off")
else:
kr.sendText(msg.to,"Protection Qr already off")
else:
wait["linkprotect"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Qr already Off")
else:
kr.sendText(msg.to,"Protection Qr already Off")
if wait["inviteprotect"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Invite already Off")
else:
kr.sendText(msg.to,"Protection Invite already Off")
else:
wait["inviteprotect"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Invite already Off")
else:
kr.sendText(msg.to,"Protection Invite already Off")
if wait["cancelprotect"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Cancel already Off")
else:
kr.sendText(msg.to,"Protection Cancel already Off")
else:
wait["cancelprotect"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Cancel already Off")
else:
kr.sendText(msg.to,"Protection Cancel already Off")
#========================== FOR COMMAND BOT STARTING =============================#
elif msg.text.lower() == 'contact on':
if wait["contact"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"ɕσηϯαɕϯ ςεϯ ϯσ ση")
else:
kr.sendText(msg.to,"ɕσηϯαɕϯ ςεϯ ϯσ ση")
else:
wait["contact"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"ɕσηϯαɕϯ ςεϯ ϯσ ση")
else:
kr.sendText(msg.to,"ɕσηϯαɕϯ ςεϯ ϯσ ση")
elif msg.text.lower() == 'contact off':
if wait["contact"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"ɕσηϯαɕϯ ςεϯ ϯσ σƒƒ")
else:
kr.sendText(msg.to,"ɕσηϯαɕϯ αʆɾεαδψ σƒƒ")
else:
wait["contact"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"ɕσηϯαɕϯ ςεϯ ϯσ σƒƒ")
else:
kr.sendText(msg.to,"ɕσηϯαɕϯ αʆɾεαδψ σƒƒ")
elif msg.text.lower() == 'protect on':
if wait["protect"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protecion Already On")
else:
kr.sendText(msg.to,"Protecion Already On")
else:
wait["protect"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protecion Already On")
else:
kr.sendText(msg.to,"Protecion Already On")
elif msg.text.lower() == 'qr on':
if wait["linkprotect"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Qr already On")
else:
kr.sendText(msg.to,"Protection Qr already On")
else:
wait["linkprotect"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Qr already On")
else:
kr.sendText(msg.to,"Protection Qr already On")
elif msg.text.lower() == 'invite on':
if wait["inviteprotect"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Invite already On")
else:
kr.sendText(msg.to,"Protection Invite already On")
else:
wait["inviteprotect"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"ρяσтє¢тισи ιиνιтє ѕєт тσ σи")
else:
kr.sendText(msg.to,"ρяσтє¢тισи ιиνιтє αℓяєα∂у σи")
elif msg.text.lower() == 'cancel on':
if wait["cancelprotect"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"¢αи¢єℓ ρяσтє¢тισи ѕєт тσ σи")
else:
kr.sendText(msg.to,"¢αи¢єℓ ρяσтє¢тισи αℓяєα∂у σи")
else:
wait["cancelprotect"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"¢αи¢єℓ ρяσтє¢тισи ѕєт тσ σи")
else:
kr.sendText(msg.to,"¢αи¢єℓ ρяσтє¢тισи αℓяєα∂у σи")
elif msg.text.lower() == 'autojoin on':
if wait["autoJoin"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"αυтσʝσιи ѕєт тσ σи")
else:
kr.sendText(msg.to,"αυтσʝσιи αℓяєα∂у σи")
else:
wait["autoJoin"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"αυтσʝσιи ѕєт тσ σи")
else:
kr.sendText(msg.to,"αυтσʝσιи αℓяєα∂у σи")
elif msg.text.lower() == 'autojoin off':
if wait["autoJoin"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"αυтσʝσιи ѕєт тσ σff")
else:
kr.sendText(msg.to,"αυтσʝσιи αℓяєα∂у σff")
else:
wait["autoJoin"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"αυтσʝσιи ѕєт тσ σff")
else:
kr.sendText(msg.to,"αυтσʝσιи αℓяєα∂у σff")
elif msg.text.lower() == 'protect off':
if wait["protect"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection already Off")
else:
kr.sendText(msg.to,"Protection already Off")
else:
wait["protect"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"ρяσтє¢тισи ѕєт тσ σff")
else:
kr.sendText(msg.to,"ρяσтє¢тισи αℓяєα∂у σff")
elif msg.text.lower() == 'qr off':
if wait["linkprotect"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Qr already off")
else:
kr.sendText(msg.to,"Protection Qr already off")
else:
wait["linkprotect"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Qr already Off")
else:
kr.sendText(msg.to,"Protection Qr already Off")
elif msg.text.lower() == 'invit off':
if wait["inviteprotect"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Invite already Off")
else:
kr.sendText(msg.to,"Protection Invite already Off")
else:
wait["inviteprotect"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Invite already Off")
else:
kr.sendText(msg.to,"Protection Invite already Off")
elif msg.text.lower() == 'cancel off':
if wait["cancelprotect"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Cancel already Off")
else:
kr.sendText(msg.to,"Protection Cancel already Off")
else:
wait["cancelprotect"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"Protection Cancel already Off")
else:
kr.sendText(msg.to,"Protection Cancel already Off")
elif "Grup cancel:" in msg.text:
try:
strnum = msg.text.replace("Grup cancel:","")
if strnum == "off":
wait["autoCancel"]["on"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"Itu off undangan ditolak??\nSilakan kirim dengan menentukan jumlah orang ketika Anda menghidupkan")
else:
kr.sendText(msg.to,"Off undangan ditolak??Sebutkan jumlah terbuka ketika Anda ingin mengirim")
else:
num = int(strnum)
wait["autoCancel"]["on"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,strnum + "Kelompok berikut yang diundang akan ditolak secara otomatis")
else:
kr.sendText(msg.to,strnum + "The team declined to create the following automatic invitation")
except:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Nilai tidak benar")
else:
kr.sendText(msg.to,"Weird value")
elif msg.text.lower() == 'autoleave on':
if wait["leaveRoom"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Auto Leave room set to on")
else:
kr.sendText(msg.to,"Auto Leave room already on")
else:
wait["leaveRoom"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"Auto Leave room set to on")
else:
kr.sendText(msg.to,"Auto Leave room already on")
elif msg.text.lower() == 'autoleave off':
if wait["leaveRoom"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Auto Leave room set to off")
else:
kr.sendText(msg.to,"Auto Leave room already off")
else:
wait["leaveRoom"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"Auto Leave room set to off")
else:
kr.sendText(msg.to,"Auto Leave room already off")
elif msg.text.lower() == 'share on':
if wait["timeline"] == True:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Share set to on")
else:
kr.sendText(msg.to,"Share already on")
else:
wait["timeline"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"Share set to on")
else:
kr.sendText(msg.to,"Share already on")
elif msg.text.lower() == 'share off':
if wait["timeline"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Share set to off")
else:
kr.sendText(msg.to,"Share already off")
else:
wait["timeline"] = False
if wait["lang"] == "JP":
kr.sendText(msg.to,"Share set to off")
else:
kr.sendText(msg.to,"Share already off")
elif msg.text.lower() == 'set':
md = """BABANG-ADHI"""
if wait["contact"] == True: md+="Contact:on [✅]\n"
else: md+="Contact:off [❌]\n"
if wait["autoJoin"] == True: md+="Auto Join:on [✅]\n"
else: md +="Auto Join:off [❌]\n"
if wait["autoCancel"]["on"] == True:md+="Auto cancel:" + str(wait["autoCancel"]["members"]) + "[✅]\n"
else: md+= "Group cancel:off [❌]\n"
if wait["leaveRoom"] == True: md+="Auto leave:on [✅]\n"
else: md+="Auto leave:off [❌]\n"
if wait["timeline"] == True: md+="Share:on [✅]\n"
else:md+="Share:off [❌]\n"