-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathanu.py
5452 lines (5409 loc) · 320 KB
/
anu.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
# REMAKEBOT
# BOT SC HERE
from linepy import *
from akad.ttypes import Message
from akad.ttypes import ContentType as Type
from akad.ttypes import ChatRoomAnnouncementContents
from akad.ttypes import ChatRoomAnnouncement
from datetime import datetime, timedelta
from time import sleep
from bs4 import BeautifulSoup
from humanfriendly import format_timespan, format_size, format_number, format_length
import time, random, sys, json, codecs, threading, glob, re, string, os, requests, subprocess, six, ast, pytz, urllib, urllib.parse, ffmpy, wikipedia, atexit, datetime, pafy, youtube_dl
_session = requests.session()
from gtts import gTTS
from googletrans import Translator
#==============================================================================================================
botStart = time.time()
#==============================================================================================================
client = LINE ('EvgZ4Ovr32fwX50e3605.IqtJipTzyCWvcrgownX/bq.06Q/P/3H2mbuBz8dvmLiG1/l+S7QQZY2R71g9kSdeUs=')
#==============================================================================================================
readOpen = codecs.open("read.json","r","utf-8")
settingsOpen = codecs.open("temp.json","r","utf-8")
stickersOpen = codecs.open("sticker.json","r","utf-8")
imagesOpen = codecs.open("image.json","r","utf-8")
#==============================================================================================================
mid = client.getProfile().mid
#==============================
clientMID = client.profile.mid
#==============================
clientProfile = client.getProfile()
#==============================================================================================================
clientSettings = client.getSettings()
#==============================================================================================================
clientPoll = OEPoll(client)
#==============================================================================================================
admin = "u8904e320fb5961cc1509118e58dc7e05"
owner = "u8904e320fb5961cc1509118e58dc7e05"
Bots=[mid,"u8904e320fb5961cc1509118e58dc7e05"]
#==============================================================================================================
#==============================================================================================================
contact = client.getProfile()
backup = client.getProfile()
backup.displayName = contact.displayName
backup.statusMessage = contact.statusMessage
backup.pictureStatus = contact.pictureStatus
squareChatMid='mdbd283c4f8e1840fbcecf1e0e0fd9288'
#helpMute = """Switched to normal mode"""
#helpUnmute = """I'll be here when you need me"""
#==============================================================================================================
msg_dict = {}
msg_image={}
msg_video={}
msg_sticker={}
unsendchat = {}
temp_flood = {}
wbanlist = []
read = {
"readPoint":{},
"readMember":{},
"readTime":{},
"ROM":{},
}
sider = {
"point":{},
"cyduk":{},
"sidermem":{}
}
#==============================================================================================================
myProfile = {
"displayName": "",
"statusMessage": "",
"pictureStatus": ""
}
#==============================================================================================================
myProfile["displayName"] = clientProfile.displayName
myProfile["statusMessage"] = clientProfile.statusMessage
myProfile["pictureStatus"] = clientProfile.pictureStatus
#==============================================================================================================
read = json.load(readOpen)
settings = json.load(settingsOpen)
#images = json.load(imagesOpen)
stickers = json.load(stickersOpen)
msg_dict = {}
bl = ["u31d8aba9dff04c75242f2a2097b8adae"]
try:
with open("Log_data.json","r",encoding="utf_8_sig") as f:
msg_dict = json.load(f.read())
except:
print("Couldn't read Log data")
# with open('welcomemsg.json', 'r') as fp:
# welcomemsg = json.load(fp)
#==============================================================================================================
#if settings["restartPoint"] != None:
# client.sendMessage(settings["restartPoint"], "Programs return!")
# settings["restartBot"] = None
#==============================================================================================================
def RhyN_(to, mid):
try:
aa = '{"S":"0","E":"3","M":'+json.dumps(mid)+'}'
text_ = '@Rh'
client.sendMessage(to, text_, contentMetadata={'MENTION':'{"MENTIONEES":['+aa+']}'}, contentType=0)
except Exception as error:
logError(error)
#==============================================================================================================
def cTime_to_datetime(unixtime):
return datetime.datetime.fromtimestamp(int(str(unixtime)[:len(str(unixtime))-3]))
def dt_to_str(dt):
return dt.strftime('%H:%M:%S')
def delExpire():
if temp_flood != {}:
for tmp in temp_flood:
if temp_flood[tmp]["expire"] == True:
if time.time() - temp_flood[tmp]["time"] >= 3*10:
temp_flood[tmp]["expire"] = False
temp_flood[tmp]["time"] = time.time()
try:
userid = "https://line.me/ti/p/~" + client.profile.userid
client.sendFooter(tmp, "Spam is over , Now Bots Actived !", str(userid), "http://dl.profile.line-cdn.net/"+client.getContact(clientMID).pictureStatus, client.getContact(clientMID).displayName)
except Exception as error:
logError(error)
def load():
global images
global stickers
with open("image.json","r") as fp:
images = json.load(fp)
with open("sticker.json","r") as fp:
stickers = json.load(fp)
def sendSticker(to, version, packageId, stickerId):
contentMetadata = {
'STKVER': version,
'STKPKGID': packageId,
'STKID': stickerId
}
client.sendMessage(to, '', contentMetadata, 7)
def sendImage(to, path, name="image"):
try:
if settings["server"] == "VPS":
client.sendImageWithURL(to, str(path))
except Exception as error:
logError(error)
#==============================================================================================================
def logError(text):
client.log("[ INFO ] ERROR : " + str(text))
time_ = datetime.datetime.now()
with open("errorLog.txt","a") as error:
error.write("\n[%s] %s" % (str(time_), text))
#==============================================================================================================
def delete_log():
ndt = datetime.datetime.now()
for data in msg_dict:
if (datetime.datetime.utcnow() - cTime_to_datetime(msg_dict[data]["createdTime"])) > datetime.timedelta(1):
del msg_dict[msg_id]
def changeVideoAndPictureProfile(pict, vids):
try:
files = {'file': open(vids, 'rb')}
obs_params = client.genOBSParams({'oid': clientMID, 'ver': '2.0', 'type': 'video', 'cat': 'vp.mp4'})
data = {'params': obs_params}
r_vp = client.server.postContent('{}/talk/vp/upload.nhn'.format(str(client.server.LINE_OBS_DOMAIN)), data=data, files=files)
if r_vp.status_code != 201:
return "Failed update profile"
client.updateProfilePicture(pict, 'vp')
return "Success update profile"
except Exception as e:
raise Exception("Error change video and picture profile {}".format(str(e)))
def changeProfileVideo(to):
if settings['changeProfileVideo']['picture'] == None:
return client.sendMessage(to, "Foto tidak ditemukan")
elif settings['changeProfileVideo']['video'] == None:
return client.sendMessage(to, "Video tidak ditemukan")
else:
path = settings['changeProfileVideo']['video']
files = {'file': open(path, 'rb')}
obs_params = client.genOBSParams({'oid': client.getProfile().mid, 'ver': '2.0', 'type': 'video', 'cat': 'vp.mp4'})
data = {'params': obs_params}
r_vp = client.server.postContent('{}/talk/vp/upload.nhn'.format(str(client.server.LINE_OBS_DOMAIN)), data=data, files=files)
if r_vp.status_code != 201:
return client.sendMessage(to, "Gagal update profile")
path_p = settings['changeProfileVideo']['picture']
settings['changeProfileVideo']['status'] = False
client.updateProfilePicture(path_p, 'vp')
def speedtest(secs):
mins, secs = divmod(secs,60)
hours, mins = divmod(mins,60)
days, hours = divmod(hours,24)
weaks, days = divmod(days,7)
if days == 0:
return '%02d' % (secs)
elif days > 0 and weaks == 0:
return '%02d' %(secs)
elif days > 0 and weaks > 0:
return '%02d' %(secs)
#==============================================================================================================
def command(text):
pesan = text.lower()
if pesan.startswith(settings["keyCommand"]):
cmd = pesan.replace(settings["keyCommand"],"")
else:
cmd = "Undefined command"
return cmd
#==============================================================================================================
helpmsg ="""INI BOTS
Me
Mymid
Mystickers
Updatename 「text」
Upstatus「text」
Update pict
Myname
Mypicture
Mybio
Myvideo
Mycover
Myprofile
Mid「@」
Contact「@」
Name「@」
Bio「@」
Pict「@」
Video「@」
Cover「@」
Getid「@」
Getid「Pm」
Media Command :
Line「idline」
Calc「num」
Wikipedia「query」
1cak
Motivation
Image「query」
Devianart「query」
Asking「query」
Searchporn「query」
Anime「query」
Searchmanga「query」
Searchanime「query」
Searchcharacter「query」
Gif「query」
Topnews
Music
Biography
Memecode
Creepypasta
Svideo「query」
Quote
Infomovie「text」
Fs「text」
Imagetext「text」
Groupbcast「text」
Friendbcast「text」
Fdcastvoice「text」
Gcastvoice「text」
Guess
Raffle
Flipacoin
Bitcoin
Zodiacind「zodiac」
Urban「query」
Zodiac「zodiac」
Zodiaceng「zodiac」
Instagram「username」
Motivate
Fight
Cinema
Nekopoi
Suggestion「name」
Prankcall「num」
Prankmsg 「num」
Whois「name」
Status「name」
Timezone「locate」
Group Command :
Ats
Ticket
Newticket
Makers
About
Wordban「text」
Delwordban「text」
Wordbanlist
Addfriend「@」
Unfriend「@」
Unfriendall
Unsend「num」
Getannounce
Announallgroup「text」
Announcelink「text|link」
Gcastannoun「text|link」
Announcetext「text」
Announcecrash「text」
Announcecam「text」
Announclear
Gpict
Clearallinvites
Square
Update gpict
Group pending
Groups
Ginfo
Friendlist
Favoritelist
Block:add「@」
Blockmid「mid」
Unblock「mid」
Blocklist
Square
Time
Ban:add「@」
Ban:del「@」
Clearban
Banlist
Ourl
Curl
Spam on|num|text
Gn「text」
Recall「num」
Stag「num @」
Gift「num @」
Blank「num @」
Kick「@」
Ulti「@」
Slain「@」
Reinv「@」
Invite「@」
Mimic:add「@」
Mimic:del「@」
Mimiclist
Lurking on
Lurking off
Luking reset
Lurking result
Setread1「text」
Setread2「text」
Reader on/off
Settings Command :
Status
Detailuser on/off
Autojoinqr on/off
Autojoin on/off
Autoblock on/off
Autoadd on/off
Autoleave on/off
Autoread on/off
Resendchat on/off
Autorespon on/off
Responchat on/off
Welcomeimg on/off
Welcomemsg on/off
Leavemsg on/off
Sleepmode on/off
Notag on/off
Antisticker on/off
Getreader on/off
Message set command :
Addgetreadersticker
Delgetreadersticker
Setgetreader:
Autorespon
Addautoresponsticker
Delautoresponsticker
Setautorespon:「text」
Setresponchat:「text」
Autoadd
Addautoaddsticker
Delautoaddsticker
Setautoadd:「text」
Sleepmode
Addsleepmodesticker
Delsleepmodesticker
Setsleepmode:「text」
Leavemessage
Addleavesticker
delleavesticker
Setleavemsg:「text」
Welcomemessage
Addwelcomesticker
Delwelcomesticker
Setwelcomemsg:「text」
HAPPY GOOD DAY CAPUCCINO \m/"""
helpmusic ="""「 Music 」
• Key: Music「query」
• Detail Music
• Key: Music 「query | num 」"""
helpbio ="""「 Biography 」
• Key: Biography「query」
• Detail Biography
• Key: Biography「query num」"""
helptrans= """「 TransLator 」
• af : Afrikaans
• sq : Albanian
• ar : Arabic
• hy : Armenian
• bn : Bengali
• ca : Catalan
• zh : Chinese
• zhcn : Chinese
• zhtw : Chinese
• zhyue : Chinese
• hr : Croatian
• cs : Czech
• da : Danish
• nl : Dutch
• en : English
• enau : English
• enuk : English
• enus : English
• eo : Esperanto
• fi : Finnish
• fr : French
• de : German
• el : Greek
• hi : Hindi
• hu : Hungarian
• s : Icelandic
• id : Indonesian
• it : Italian
• ja : Japanese
• km : Khme
• ko : Korean
• la : Latin
• lv : Latvian
• mk : Macedonian
• no : Norwegian
• pl : Polish
• pt : Portuguese
• ro : Romanian
• ru : Russian
• sr : Serbian
• si : Sinhala
• sk : Slovak
• es : Spanish
• eses : Spanish
• esus : Spanish
• sw : Swahili
• sv : Swedish
• ta : Tamil
• th : Thai
• tr : Turkish
• uk : Ukrainian
• vi : Vietnamese
example :
tr-en saya tampan
say-en saya keren"""
#==============================================================================================================
#==============================================================================================================
#=============================================[ OPERATION STARTED ]============================================
#==============================================================================================================
def lineBot(op):
try:
if op.type == 0:
return
#==============================================================================================================
#=============================================[OP TYPE 5 AUTO ADD]=============================================
#==============================================================================================================
if op.type == 5:
print ("[ 5 ] NOTIFIED ADD CONTACT")
if settings["autoAdd"] == True:
client.findAndAddContactsByMid(op.param1)
msgSticker = settings["messageSticker"]["listSticker"]["addSticker"]
if msgSticker != None:
sid = msgSticker["STKID"]
spkg = msgSticker["STKPKGID"]
sver = msgSticker["STKVER"]
sendSticker(op.param1, sver, spkg, sid)
if "@!" in settings["addPesan"]:
msg = settings["addPesan"].split("@!")
return sendMention(op.param1, op.param1, msg[0], msg[1])
sendMention(op.param1, op.param1, "Halo", ", {}".format(str(settings['addPesan'])))9
arg = " New Friend : {}".format(str(client.getContact(op.param1).displayName))
print (arg)
if op.type == 5:
print ("[ 5 ] NOTIFIED AUTO BLOCK CONTACT")
if settings["autoBlock"] == True:
client.blockContact(op.param1)
client.sendMessage(to, "YOU HAS BEEN BLOCKED")
if op.type == 13:
print ("[ 13 ] NOTIFIED INVITE INTO GROUP")
group = client.getGroup(op.param1)
contact = client.getContact(op.param2)
if settings["autoJoin"] and clientMID in op.param3:
client.acceptGroupInvitation(op.param1)
sendMention(op.param1, op.param2, "Hello", ", thanks for invite me")
#==============================================================================================================
#==============================================[OP TYPE 13 JOIN]===============================================
#==============================================================================================================
#==============================================================================================================
#==============================================================================================================
if op.type == 15:
print ("[ 15 ] NOTIFIED LEAVE GROUP")
if settings["leaveMessage"] == True:
if "{gname}" in settings['leavePesan']:
gName = client.getGroup(op.param1).name
msg = settings['leavePesan'].replace("{gname}", gName)
msgSticker = settings["messageSticker"]["listSticker"]["leaveSticker"]
if msgSticker != None:
sid = msgSticker["STKID"]
spkg = msgSticker["STKPKGID"]
sver = msgSticker["STKVER"]
sendSticker(op.param2, sver, spkg, sid)
if "@!" in settings['leavePesan']:
msg = msg.split("@!")
return sendMention(op.param2, op.param2, msg[0], msg[1])
return sendMention(op.param2, op.param2, "Hallo ", msg)
msgSticker = settings["messageSticker"]["listSticker"]["leaveSticker"]
if msgSticker != None:
sid = msgSticker["STKID"]
spkg = msgSticker["STKPKGID"]
sver = msgSticker["STKVER"]
sendSticker(op.param1, sver, spkg, sid)
sendMention(op.param1, op.param2, "Bye", "{}".format(str(settings['leavePesan'])))
if op.type == 17:
print ("[ 17 ] NOTIFIED ACCEPT GROUP INVITATION")
if settings["welcomeMessage"] == True:
group = client.getGroup(op.param1)
contact = client.getContact(op.param2)
msgSticker = settings["messageSticker"]["listSticker"]["welcomeSticker"]
if msgSticker != None:
sid = msgSticker["STKID"]
spkg = msgSticker["STKPKGID"]
sver = msgSticker["STKVER"]
sendSticker(op.param1, sver, spkg, sid)
if "{gname}" in settings['welcomePesan'].lower():
gName = group.name
msg = settings['welcomePesan'].replace("{gname}", gName)
if "@!" in msg:
msg = msg.split("@!")
return sendMention(op.param1, op.param2, msg[0], msg[1])
sendMention(op.param1, op.param2, "Hi", msg)
else:
sendMention(op.param1, op.param2, "Hi", "{}".format(str(settings['welcomePesan'])))
arg = " Group Name : {}".format(str(group.name))
arg += "\n User Join : {}".format(str(contact.displayName))
print (arg)
#==============================================================================================================
#==============================================[OP TYPE 22 24 JOIN]============================================
#==============================================================================================================
if op.type == 22:
print ("[ 22 ] NOTIFIED INVITE INTO ROOM")
if settings["autoLeave"] == True:
client.sendMessage(op.param1, "ngapain invite gw -,-")
client.leaveRoom(op.param1)
if op.type == 24:
print ("[ 24 ] NOTIFIED LEAVE ROOM")
if settings["autoLeave"] == True:
client.sendMessage(op.param1, "Goblok ngapain invite gw")
client.leaveRoom(op.param1)
if op.type in [25,26]:
print ("[ 25 ] SEND MESSAGE")
msg = op.message
text = msg.text
msg_id = msg.id
receiver = msg.to
sender = msg._from
if msg.toType == 0 or msg.toType == 2:
if msg.toType == 0:
to = receiver
elif msg.toType == 2:
to = receiver
if msg.contentType == 0:
if text is None:
return
else:
cmd = command(text)
if msg.text:
if msg.text.lower().lstrip().rstrip() in wbanlist:
if msg.text not in clientMID:
try:
client.kickoutFromGroup(msg.to,[sender])
except Exception as e:
print(e)
if receiver in temp_flood:
if temp_flood[receiver]["expire"] == True:
if cmd == "open":
temp_flood[receiver]["expire"] = False
temp_flood[receiver]["time"] = time.time()
client.sendMessage(to,"Bot Actived")
return
elif time.time() - temp_flood[receiver]["time"] <= 5:
temp_flood[receiver]["flood"] += 1
if temp_flood[receiver]["flood"] >= 20:
temp_flood[receiver]["flood"] = 0
temp_flood[receiver]["expire"] = True
ret_ = "I will be off for 30 seconds, type open to re-enable"
userid = "https://line.me/ti/p/~" + client.profile.userid
client.sendFooter(to, "Flood Detect !\n"+str(ret_), str(userid), "http://dl.profile.line-cdn.net/"+client.getContact(clientMID).pictureStatus, client.getContact(clientMID).displayName)
else:
temp_flood[receiver]["flood"] = 0
temp_flood[receiver]["time"] = time.time()
else:
temp_flood[receiver] = {
"time": time.time(),
"flood": 0,
"expire": False
}
if op.type == 26:
# if settings ["mutebot2"] == True:
msg = op.message
try:
if msg.toType == 0:
client.log("[%s]"%(msg._from)+str(msg.text))
else:
group = client.getGroup(msg.to)
contact = client.getContact(msg._from)
client.log("[%s]"%(msg.to)+"\nGroupname: "+str(group.name)+"\nNamenya: "+str(contact.displayName)+"\nPesannya: "+str(msg.text))
if msg.contentType == 0:
#Save message to dict
msg_dict[msg.id] = {"text":msg.text,"from":msg._from,"createdTime":msg.createdTime}
if msg.contentType == 7:
stk_id = msg.contentMetadata['STKID']
stk_ver = msg.contentMetadata['STKVER']
pkg_id = msg.contentMetadata['STKPKGID']
ret_ = "="
ret_ += "\nSTICKER ID : {}".format(stk_id)
ret_ += "\nSTICKER PACKAGES ID : {}".format(pkg_id)
ret_ += "\nSTICKER VERSION : {}".format(stk_ver)
ret_ += "\nSTICKER URL : line://shop/detail/{}".format(pkg_id)
ret_ += "\n"
msg_dict[msg.id] = {"text":str(ret_),"from":msg._from,"createdTime":msg.createdTime}
except Exception as e:
print(e)
#==============================================================================================================
if op.type == 25:
# if settings ["mutebot2"] == True:
msg = op.message
text = msg.text
msg_id = msg.id
receiver = msg.to
sam = squareChatMid
sender = msg._from
if msg.toType == 0:
if sender != client.profile.mid:
to = sender
else:
to = receiver
else:
to = receiver
if msg.contentType == 0:
if text is None:
return
elif msg.text.lower().startswith("setread1 "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
settings["anu"] = str(say).lower()
client.sendMessage(msg.to, "Reader point set to 「 " + str(settings["anu"]) + " 」")
elif msg.text.lower().startswith("setread2 "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
settings["anu2"] = str(say).lower()
client.sendMessage(msg.to, "Reader point set to 「 " + str(settings["anu2"]) + " 」")
elif msg.text.lower().startswith("say "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
client.sendMessage(to, (say))
assist.sendMessage(to, (say))
kicker.sendMessage(to, (say))
kicker2.sendMessage(to, (say))
#==============================================================================================================
elif text.lower() == "help" or text.lower() == ".":
helpmessagee = helpmsg
client.sendMessage(to, str(helpmessagee))
elif text.lower() == "self" or text.lower() == ".":
helpselfbot = helpself
client.sendMessage(to, str(helpselfbot))
elif text.lower() == "fiture" or text.lower() == ".":
helpftr = helpfiture
client.sendMessage(to, str(helpftr))
elif text.lower() == "update" or text.lower() == ".":
helpup = helpupdate
client.sendMessage(to, str(helpup))
elif text.lower() == "group" or text.lower() == ".":
helpgc = helpgroup
client.sendMessage(to, str(helpgc))
elif text.lower() == "reader" or text.lower() == ".":
helprd = helpread
client.sendMessage(to, str(helprd))
elif text.lower() == "author" or text.lower() == ".":
helpaut = helpauthor
client.sendMessage(to, str(helpaut))
elif text.lower() == "stealing" or text.lower() == ".":
helpst = helpsteal
client.sendMessage(to, str(helpst))
elif text.lower() == "spaming" or text.lower() == ".":
helpsp = helpspam
client.sendMessage(to, str(helpsp))
elif text.lower() == "settings" or text.lower() == ".":
helpsett = helpset
client.sendMessage(to, str(helpsett))
elif text.lower() == "banning" or text.lower() == ".":
helpbn = helpban
client.sendMessage(to, str(helpbn))
elif text.lower() == "translate" or text.lower() == ".":
helptr = helptrans
client.sendMessage(to, str(helptr))
elif text.lower() == "lyric" or text.lower() == ".":
helply= helplyric
client.sendMessage(to, str(helply))
elif text.lower() == "youtube" or text.lower() == ".":
helpyt = helpytube
client.sendMessage(to, str(helpyt))
elif text.lower() == "camera" or text.lower() == ".":
helpcm = helpcam
client.sendMessage(to, str(helpcm))
elif text.lower() == "music" or text.lower() == ".":
helpmc = helpmusic
client.sendMessage(to, str(helpmc))
elif text.lower() == "kaskus" or text.lower() == ".":
helpks = helpkus
client.sendMessage(to, str(helpks))
elif text.lower() == "soundcloud" or text.lower() == ".":
helpsd = helpsound
client.sendMessage(to, str(helpsd))
elif text.lower() == "news" or text.lower() == ".":
helpnw = helpnews
client.sendMessage(to, str(helpnw))
elif text.lower() == "province" or text.lower() == ".":
helppv = helpprov
client.sendMessage(to, str(helppv))
elif text.lower() == "brainly" or text.lower() == ".":
helpbr = helpbran
client.sendMessage(to, str(helpbr))
elif text.lower() == "lyric" or text.lower() == ".":
helprik = helpry
client.sendMessage(to, str(helprik))
elif msg.text.lower().startswith("contact "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
client.sendMessage(receiver, None, contentMetadata={'mid': say}, contentType=13)
#==============================================================================================================
#==============================================================================================================
#==============================================================================================================
elif msg.text.lower() == "invite:on":
if msg._from in clientMID:
settings["winvite"] = True
client.sendMessage(msg.to,"Send Contact to Invite")
#==============================================================================================================
elif "Kick " in msg.text:
if msg._from in clientMID:
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"][0]["M"]
targets = []
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
client.kickoutFromGroup(msg.to,[target])
except:
pass
elif "Vkick " in msg.text:
if msg._from in clientMID:
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"][0]["M"]
targets = []
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
client.kickoutFromGroup(msg.to,[target])
client.inviteIntoGroup(msg.to,[target])
client.cancelGroupInvitation(msg.to,[target])
except:
pass
elif "Invite " in msg.text:
if msg._from in clientMID:
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"][0]["M"]
targets = []
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
client.findAndAddContactsByMid(target)
client.inviteIntoGroup(msg.to,[target])
except:
pass
#==============================================================================================================
elif msg.text.lower().startswith("say-af "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'af'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-sq "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'sq'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-ar "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'ar'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-hy "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'hy'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-bn "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'bn'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-ca "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'ca'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-zh "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'zh'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-zh-cn "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'zh-cn'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-zh-tw "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'zh-tw'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-zh-yue "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'zh-yue'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-hr "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'hr'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-cs "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'cs'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-da "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'da'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-nl "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'nl'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-en "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'en'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-en-au "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'en-au'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-en-uk "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'en-uk'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-en-us "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'en-us'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-eo "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'eo'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-fi "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'fi'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-fr "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'fr'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-de "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'de'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-el "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'el'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-hi "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'hi'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-hu "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'hu'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-is "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'is'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-id "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'id'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-it "):
sep = text.split(" ")
say = text.replace(sep[0] + " ","")
lang = 'it'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
client.sendAudio(msg.to,"hasil.mp3")
elif msg.text.lower().startswith("say-ja "):
sep = text.split(" ")