-
Notifications
You must be signed in to change notification settings - Fork 49
/
index.js
1633 lines (1502 loc) · 72.2 KB
/
index.js
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
/**
* ORIGINALY BY : github.com/LoL-Human
* RECODE BY : LINDOW & MEGA & FAZONE
**/
const {
WAConnection,
MessageType,
Presence,
MessageOptions,
Mimetype,
WALocationMessage,
WA_MESSAGE_STUB_TYPES,
ReconnectMode,
ProxyAgent,
GroupSettingChange,
ChatModification,
waChatKey,
WA_DEFAULT_EPHEMERAL,
mentionedJid,
processTime
} = require("@adiwajshing/baileys")
const moment = require("moment-timezone");
const FormData = require('form-data')
const imageToBase64 = require('image-to-base64');
const speed = require('performance-now');
const chalk = require('chalk');
const request = require('request');
const fs = require('fs');
const { exec } = require('child_process');
const ffmpeg = require('fluent-ffmpeg');
const axios = require('axios');
const fetch = require('node-fetch');
const { onGoing } = require("./lib/otakudesu.js")
const { covid } = require("./lib/covid.js")
const { downAndro1, searchAndro1 } = require("./lib/andro.js")
const { cnn } = require("./lib/cnn.js")
const { ssstik } = require("./lib/tiktok.js")
const { Gempa } = require("./lib/gempa.js");
const { SearchKartun, Movie, Drama, Action, Adventure } = require("./lib/kartun.js")
const { herolist } = require("./lib/herolist.js")
const { herodetails } = require("./lib/herodetail.js")
const conn = require("./lib/connect")
const msg = require("./lib/message")
const wa = require("./lib/wa")
const Exif = require('./lib/exif');
const exif = new Exif();
const { recognize } = require('./lib/ocr');
const help = require("./lib/help")
const postBuffer = help.postBuffer
const getBuffer = help.getBuffer
const getRandom = help.getRandomExt
const postJson = help.postJson
const getJson = help.getJson
const config = JSON.parse(fs.readFileSync("./config.json"))
const owner = config.owner
const mods = config.mods
var public = config.public
// Database
const imagenye = JSON.parse(fs.readFileSync('./database/image.json'))
conn.connect()
const megayaa = conn.megayaa
const sleep = async (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
fakeimage = fs.readFileSync(`./lib/image/foto2.jpg`)
fake = 'Simple Selfbot'
prefix = 'z'
apikey = 'LindowApi' // Free Apikey!
hit_today = []
megayaa.on('CB:action,,call', async json => {
const callerId = json[2][0][1].from;
console.log("call dari "+ callerId)
megayaa.sendMessage(callerId, "Auto block system, don't call please", MessageType.text)
await sleep(4000)
await megayaa.blockUser(callerId, "add") // Block user
})
megayaa.on('group-participants-update', async(chat) => {
try {
var member = chat.participants
for (var x of member) {
try {
if (x == megayaa.user.jid) return
var photo = await wa.getPictProfile(x)
var username = await wa.getUserName(x) || "Guest"
var from = chat.jid
var group = await megayaa.groupMetadata(from)
if (chat.action == 'add' && public) {
text = `${username}, Wecome to ${group.subject}`
wa.sendImage(from, photo, text)
}
if (chat.action == 'remove' && public) {
text = `${username}, Sayonara 👋`
await wa.sendMessage(from, text)
}
} catch {
continue
}
}
} catch (e) {
console.log(chalk.whiteBright("├"), chalk.keyword("aqua")("[ ERROR ]"), chalk.keyword("red")(e))
}
})
megayaa.on('chat-update', async(lin) => {
try {
if (!lin.hasNewMessage) return
if (!lin.messages) return
if (lin.key && lin.key.remoteJid == 'status@broadcast') return
lin = lin.messages.all()[0]
if (!lin.message) return
const from = lin.key.remoteJid
const type = Object.keys(lin.message)[0]
const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType
const quoted = type == 'extendedTextMessage' && lin.message.extendedTextMessage.contextInfo != null ? lin.message.extendedTextMessage.contextInfo.quotedMessage || [] : []
const typeQuoted = Object.keys(quoted)[0]
const body = lin.message.conversation || lin.message[type].caption || lin.message[type].text || ""
chats = (type === 'conversation') ? lin.message.conversation : (type === 'extendedTextMessage') ? lin.message.extendedTextMessage.text : ''
budy = (type === 'conversation' && lin.message.conversation.startsWith(prefix)) ? lin.message.conversation : (type == 'imageMessage') && lin.message.imageMessage.caption.startsWith(prefix) ? lin.message.imageMessage.caption : (type == 'videoMessage') && lin.message.videoMessage.caption.startsWith(prefix) ? lin.message.videoMessage.caption : (type == 'extendedTextMessage') && lin.message.extendedTextMessage.text.startsWith(prefix) ? lin.message.extendedTextMessage.text : ''
if (prefix != "") {
if (!body.startsWith(prefix)) {
cmd = false
comm = ""
} else {
cmd = true
comm = body.slice(1).trim().split(" ").shift().toLowerCase()
}
} else {
cmd = false
comm = body.trim().split(" ").shift().toLowerCase()
}
const reply = async(teks) => {
await megayaa.sendMessage(from, teks, MessageType.text, { quoted: lin })
}
const uploadImages = (filePath) => {
return new Promise(async (resolve, reject) => {
const fileData = fs.readFileSync(filePath)
const form = new FormData()
form.append('file', fileData, 'tmp.png')
fetch('https://telegra.ph/upload', {
method: 'POST',
body: form
})
.then(res => res.json())
.then(res => {
if (res.error) return reject(res.error)
resolve('https://telegra.ph' + res[0].src)
})
.then(() => fs.unlinkSync(filePath))
.catch(err => reject(err))
})
}
const command = comm
hit_today.push(command)
const args = body.trim().split(/ +/).slice(1)
const isCmd = cmd
const meNumber = megayaa.user.jid
const botNumber = megayaa.user.jid.split("@")[0]
const isGroup = from.endsWith('@g.us')
const arg = chats.slice(command.length + 2, chats.length)
const sender = lin.key.fromMe ? megayaa.user.jid : isGroup ? lin.participant : lin.key.remoteJid
const senderNumber = sender.split("@")[0]
const groupMetadata = isGroup ? await megayaa.groupMetadata(from) : ''
const groupName = isGroup ? groupMetadata.subject : ''
const groupMembers = isGroup ? groupMetadata.participants : ''
const groupAdmins = isGroup ? await wa.getGroupAdmins(groupMembers) : []
const isAdmin = groupAdmins.includes(sender) || false
const botAdmin = groupAdmins.includes(megayaa.user.jid)
const totalChat = megayaa.chats.all()
const itsMe = senderNumber == botNumber
const isOwner = senderNumber == owner || senderNumber == botNumber || mods.includes(senderNumber)
const mentionByTag = type == "extendedTextMessage" && lin.message.extendedTextMessage.contextInfo != null ? lin.message.extendedTextMessage.contextInfo.mentionedJid : []
const mentionByReply = type == "extendedTextMessage" && lin.message.extendedTextMessage.contextInfo != null ? lin.message.extendedTextMessage.contextInfo.participant || "" : ""
const mention = typeof(mentionByTag) == 'string' ? [mentionByTag] : mentionByTag
mention != undefined ? mention.push(mentionByReply) : []
const mentionUser = mention != undefined ? mention.filter(n => n) : []
const mentions = (teks, memberr, id) => {
(id == null || id == undefined || id == false) ? megayaa.sendMessage(from, teks.trim(), extendedText, {contextInfo: {"mentionedJid": memberr}}) : megayaa.sendMessage(from, teks.trim(), extendedText, {quoted: lin, contextInfo: {"mentionedJid": memberr}})
}
// Ucapan Waktu
const hour_now = moment().format('HH')
var ucapanWaktu = 'Pagi lindow'
if (hour_now >= '03' && hour_now <= '10') {
ucapanWaktu = 'Pagi lindow'
} else if (hour_now >= '10' && hour_now <= '14') {
ucapanWaktu = 'Siang lindow'
} else if (hour_now >= '14' && hour_now <= '17') {
ucapanWaktu = 'Soree lindow'
} else if (hour_now >= '17' && hour_now <= '18') {
ucapanWaktu = 'Selamat petang'
} else if (hour_now >= '18' && hour_now <= '23') {
ucapanWaktu = 'Malam lindow'
} else {
ucapanWaktu = 'Selamat Malam!'
}
const isImage = type == 'imageMessage'
const isVideo = type == 'videoMessage'
const isAudio = type == 'audioMessage'
const isSticker = type == 'stickerMessage'
const isContact = type == 'contactMessage'
const isLocation = type == 'locationMessage'
const isMedia = (type === 'imageMessage' || type === 'videoMessage')
typeMessage = body.substr(0, 50).replace(/\n/g, '')
if (isImage) typeMessage = "Image"
else if (isVideo) typeMessage = "Video"
else if (isAudio) typeMessage = "Audio"
else if (isSticker) typeMessage = "Sticker"
else if (isContact) typeMessage = "Contact"
else if (isLocation) typeMessage = "Location"
const isQuoted = type == 'extendedTextMessage'
const isQuotedImage = isQuoted && typeQuoted == 'imageMessage'
const isQuotedVideo = isQuoted && typeQuoted == 'videoMessage'
const isQuotedAudio = isQuoted && typeQuoted == 'audioMessage'
const isQuotedSticker = isQuoted && typeQuoted == 'stickerMessage'
const isQuotedContact = isQuoted && typeQuoted == 'contactMessage'
const isQuotedLocation = isQuoted && typeQuoted == 'locationMessage'
if (!public) {
mods.indexOf(botNumber) === -1 ? mods.push(botNumber) : false
mods.indexOf(owner) === -1 ? mods.push(owner) : false
if (!mods.includes(senderNumber)) return
mods.slice(mods.indexOf(owner), 1)
}
if (!isGroup && isCmd) console.log(chalk.whiteBright("├"), chalk.keyword("aqua")("[ COMMAND ]"), chalk.whiteBright(typeMessage), chalk.greenBright("from"), chalk.keyword("yellow")(senderNumber))
if (isGroup && isCmd) console.log(chalk.whiteBright("├"), chalk.keyword("aqua")("[ COMMAND ]"), chalk.whiteBright(typeMessage), chalk.greenBright("from"), chalk.keyword("yellow")(senderNumber), chalk.greenBright("in"), chalk.keyword("yellow")(groupName))
switch (command) {
case 'help':
textnya = `*${ucapanWaktu}*
*> for eval*
*Hit Today : ${hit_today.length}*
1. *${prefix}owner*
To send contact owner
2. *${prefix}public*
To activate public mode
3. *${prefix}self*
To activate self mode
4. *${prefix}setprefix*
To set prefix
Usage : ${prefix}setprefix yournewprefix
5. *${prefix}broadcast*
Broadcast message
Usage : ${prefix}broadcast yourmessags
6. *${prefix}setthumb*
To set or change thumbnail in menu
Usage : ${prefix}setthumb and reply your image or webp
7. *${prefix}fakethumb*
To change menu image
Usage : ${prefix}fakethumb and reply your image
8. *${prefix}stats*
To view your stat
9. *${prefix}block*
Block user
Usage : ${prefix}block 62xxxx
10. *${prefix}unblock*
Unblock user
Usage : ${prefix}unblock 62xxxx
11. *${prefix}leave*
To leave group
12. *${prefix}join*
To join group
13. *${prefix}clearall*
To clearall message
14. *${prefix}hidetag*
Hidetag group
Usage : ${prefix}hidetag halo everyone
15. *${prefix}imagetag*
Hidetag use image
Usage : send image or reply with caption ${prefix}imagetag
16. *${prefix}stickertag*
Hidetag use sticker
Usage : send sticker or reply with caption ${prefix}stickertag
17. *${prefix}promote*
Promote Member in group
Usage : ${prefix}promote @tag
18. *${prefix}demote*
Demote Member in group
Usage : ${prefix}demote @tag
19. *${prefix}admin*
To view list admin
20. *${prefix}linkgc*
To view link gc
21. *${prefix}group open/close*
To unlock or close group
22. *${prefix}setnamegc*
To change subject name gc
Usage : ${prefix}setnamegc yournewsubject
22. *${prefix}setdesc*
To set decs group
23. *${prefix}bugimg*
Usage : ${prefix}bugimg yourtext, don't space!
24. *${prefix}demoteall*
Yes, this is for demote all admin :D
25. *${prefix}ocr*
Usage : send image and reply with caption
26. *${prefix}toimg*
Make sticker to image
Usage : send image and reply with caption ${prefix}toimg
27. *${prefix}shutdown*
To shutdown bot
28. *${prefix}spam*
Spam text
Usage : ${prefix}spam text|jumlahspam
29. *${prefix}add*
Add member or someone
Usage : ${prefix}add 6289xxxx
30. *${prefix}kick*
Kick member
Usage : ${prefix}kick @tag or member
31. *${prefix}setpp*
Set or change your profile picture
Usage : send image and reply with ${prefix}setpp
32. *${prefix}chat*
You can chat mark with this feature :D
Usage : ${prefix}chat 0|Halo mark
33. *${prefix}tagall*
Tag all member in group
34. *${prefix}toptt*
Make audio to format ptt
Usage : send auto and reply with ${prefix}toptt
35. *${prefix}fordward*
Make message fordward 508 score
Usage : ${prefix}fordward yourtext
36. *${prefix}fakereply*
Make a fakereply message
Usage : ${prefix}fakereply 62xxx | targetmessage | yourmessage
37. *${prefix}unreadall*
Unread all message
38. *${prefix}readall*
Read all message
39. *${prefix}upstorypic*
Send picture or image to status whatsapp
Usage : send image and reply with your caption, ${prefix}upstorypic halo
40. *${prefix}upstoryvid*
Send video to status whatsapp
Usage : send video and reply with your caption, ${prefix}upstoryvid halo
41. *${prefix}upstory*
Send text to status whatsapp
Usage : ${prefix}upstory Hallo, i'm using bot
42. *${prefix}unmute*
Unmute chat
43. *${prefix}mute*
mute chat
44. *${prefix}delthischat*
To delete chat
45. *${prefix}archive*
To archive your chat
46. *${prefix}unarchiveall*
To unarchive all chat
47. *${prefix}pin*
To pin chat
48. *${prefix}unpin*
Unpin chat
49. *${prefix}runtime*
To view runtime bot
50. *${prefix}speed
To view your speed
51. *${prefix}sendkontak*
To send kontak
Usage : ${prefix}sendkontak @tag|Megacantikzz
52. *${prefix}term*
Term or exec
Usage : ${prefix}term ls
53. *${prefix}setreply*
To set fakereply text in menu
Usage : ${prefix}setreply mega cantikzz
54. *${prefix}setname*
To set name your whatsapp account
Usage : ${prefix}setname Megaa cantikzz
55. *${prefix}setbio*
Set bio your whatsapp account
Usage : ${prefix}setbio Mega best girlfriend >_<
56. *${prefix}fdeface*
Fakedeface web or situs
Usage : reply image with caption ${prefix}fdeface https://github.com|Title|decs
57. *${prefix}getpic*
Get profile picture member
Usage : ${prefix}getpic @tag
58. *${prefix}getbio*
Get bio whatsapp member
Usage : ${prefix}getbio @tag
59. *${prefix}sticker*
Make a photo or video to sticker
Usage : send image and reply ${prefix}sticker
60. *${prefix}swm* name | author
Make sticker with costum wm
Usage : send image or video and reply ${prefix}swm yourname | author
61. *${prefix}takestick* name | author
Change wm on sticker
Usage : send sticker and reply ${prefix}takestick yourname | author
62. *${prefix}colong* <reply stiker>
Change wm on sticker
Usage : send sticker and reply ${prefix}colong
63. *${prefix}ytsearch*
To search video youtube
usage : ${prefix}ytsearch how to make a baby
64. *${prefix}igdl*
To download Instagram post
Usage : ${prefix}igdl link
65. *${prefix}scdl*
Download music with url soundcloud
Usage : ${prefix}scdl link
65. *${prefix}ppcouple*
Get random profile picture couple
66. *${prefix}asupan*
Get random video asupan
67. *${prefix}randomaesthetic*
Get random aesthetic or amv video
68. *${prefix}quoteislam*
Get a random quoteislam
69. *${prefix}kisahnabi*
Usage : ${prefix}kisahnabi Muhammad
70. *${prefix}ayatkursi*
71. *${prefix}herodetail*
Usage : ${prefix}herodetail miya
72. *${prefix}herolist*
73. *${prefix}searchkartun*
Usage : ${prefix}searchkartun spongebob
74. *${prefix}kartunmovie*
Get a random kartun movie
75. *${prefix}kartundrama*
Get a random kartun drama
76. *${prefix}kartunaction*
Get a random kartun action
77. *${prefix}kartunadventure*
Get a random kartun adventure
78. *${prefix}gempa*
Get info about gempa
79. *${prefix}tinyurl*
Tools short url
Usage : ${prefix}tinyurl link
80. *${prefix}noprefix*
Change to no prefix mode
81. *${prefix}pinterest*
Usage : ${prefix}pinterest query
82. *${prefix}dewabatch*
Get info from dewabatch
Usage : ${prefix}dewabatch Darling in the franxx
83. *${prefix}wikipedia*
Usage : ${prefix}wikipedia query
84. *${prefix}kusonime*
Get info from kusonime
Usage : ${prefix}kusonime Darling in the franxx
85. *${prefix}ytmp3*
Download audio from youtube
Usage : ${prefix}ytmp3 link
86. *${prefix}ytmp4*
Download video from youtube
Usage : ${prefix}ytmp4 link
87. *${prefix}tiktok*
Download video from tiktok
Usage : ${prefix}tiktok link
88. *${prefix}sethelpimg*
To change thumb in menu/help
Usage : reply image with caption ${prefix}sethelpimg
89. *${prefix}searchandro1
Get info android1
Usage : ${prefix}searchandro1 sonic dash
90. *${prefix}downandro1
Usage : ${prefix}downandro1 https://an1.com/1628-sonic-dash-mod.html
91. *${prefix}cnn*
Get random news CNN
92. *${prefix}covidindo*
Get info about covid Indonesia
93. *${prefix}otakuongoing*
Get Info About otakudesu OnGoing
94. *${prefix}sfilesearch*
Search files in Sfile Mobi
95. *${prefix}sfiledl*
Download files Sfile with link
96. *${prefix}smeme*
Make sticker meme with a reply photo
*Storage Bot*
1. *${prefix}addimage*
Add image to storage
Usage : ${prefix}addimage Test
*${prefix}listimage*
To view list image
*${prefix}getimage*
Get image from storage
Usage : ${prefix}getimage Test
Join Group : https://chat.whatsapp.com/LeVT7RBq6WU1s92NIwdhfd`
wa.FakeStatusImgForwarded(from, fakeimage, textnya, fake)
reply(`Join Group : https://chat.whatsapp.com/LeVT7RBq6WU1s92NIwdhfd`)
break
case 'otakuongoing':
o = await onGoing()
console.log(o)
ot = 'Ongoing Otakudesu'
for (let i = 0; i < o.length; i++) {
ot += `\n\nJudul : ${o[i].judul}\nEpisode : ${o[i].eps}\nEps berikutnya pada hari : ${o[i].hri}\nTanggal : ${o[i].tgl}\n\nImage : ${o[i].thumb}`
}
buff = await getBuffer(o[0].thumb)
megayaa.sendMessage(from, buff, MessageType.image, {caption: ot})
break
case 'covidindo':
c = await covid()
var { kasus, kematian, sembuh } = c[0]
reply(`Kasus : ${kasus}\n\nKematian : ${kematian}\n\nSembuh : ${sembuh}`)
break
case 'downandro1':
linkdown = args.join(" ")
result = await downAndro1(linkdown)
var { judul, dev, andro, versi, genre, updated, link, size, install, rated } = result[0]
console.log(result)
caption = `Title : ${judul}\n\nDeveloper : ${dev}\nAndroid : ${andro}\nVersion : ${versi}\nGenre : ${genre}\nUpdate : ${updated}\nLink : ${link}\nSize : ${size}\nInstall : ${install}\nRating : ${rated}`
buff = await getBuffer(result[0].thumb)
megayaa.sendMessage(from, buff, MessageType.image, {caption: caption})
break
case 'searchandro1':
aplikasi = body.slice(14)
result = await searchAndro1(aplikasi)
console.log(result)
an = 'ANDROID1 SEARCH'
for (let i = 0; i < result.length; i++) {
an += `\n\nTitle : ${result[i].judul}\n\nLink : ${result[i].link}\n\n=======================`
}
buff = await getBuffer(result[0].thumb)
megayaa.sendMessage(from, buff, MessageType.image, {caption: an})
break
case 'cnn':
var result = await cnn()
console.log(result)
cn = 'CNN NEWS'
for (let i = 0; i < result.length; i++) {
cn += `\n\nTitle : ${result[i].judul}\nLink : ${result[i].link}\nImage: ${result[i].thumb}`
}
buff = await getBuffer(result[0].thumb)
megayaa.sendMessage(from, buff, MessageType.image, {caption: cn})
break
case 'owner':
await wa.sendContact(from, owner, "Your Name")
break
case 'tiktok':
url = args.join(" ")
result = await ssstik(url)
console.log(result)
buf = await getBuffer(`${result.videonowm}`)
megayaa.sendMessage(from, buf, MessageType.video, {mimetype: 'video/mp4', filename: `tiktok.mp4`, quoted: lin, caption: `${result.text}\n\nUrl music : ${result.music}`})
break
case 'smeme':
gh = body.slice(7).replace(/ /g, '%20')
wo1 = gh.split("|")[0];
wo2 = gh.split("|")[1];
if ((isMedia && !lin.message.videoMessage || isQuotedImage)) {
jars = isQuotedImage ? JSON.parse(JSON.stringify(lin).replace('quotedM','m')).message.extendedTextMessage.contextInfo : lin
wors = await megayaa.downloadAndSaveMediaMessage(jars)
datae = await imageToBase64(JSON.stringify(wors).replace(/\"/gi, ''))
fs.writeFileSync('smeme.jpeg', datae, 'base64')
anu = await uploadImages('smeme.jpeg')
baleg = await getBuffer(`https://api.memegen.link/images/custom/${wo1}/${wo2}.png?background=${anu}`)
megayaa.sendMessage(from, baleg, MessageType.image, {quoted: lin})
}
break
case "ytmp3":
if (!args.length) return reply("Masukan link nya, contoh #ytmp3 link")
var qq = args.join(" ")
var aaa = await axios.get(`https://api.lolhuman.xyz/api/ytaudio?apikey=dikyadis&url=${qq}`)
var { id, title, uploader, channel, duration, view, like, dislike, thumbnail, description } = aaa.data.result
var { link, bitrate, size } = aaa.data.result.link
var bbb = await axios.get(`https://megayaa.herokuapp.com/api/short/tiny?url=${link}`)
var captin = `*Youtube Audio Downloader*\n\n📬 *ID :* ${id}\n📜 *Judul :* ${title}\n⏱️ *Durasi :* ${duration}\n🎞️ *Tayangan :* ${view}\n🎥 *Channel :* ${uploader}\n🎁 *Type :* mp3\n💡 *Kualitas :* ${bitrate}\n⚖️ *Size :* ${size}\n📺 *Link channel :* ${channel}\n👍 *Like :* ${like}\n👎 *Dislike :* ${dislike}\n📑 *Deskripsi :* ${description}\n\n*Tunggu sebentar audio sedang dikirim*`
if (Number(size.split(' MB')[0]) >= 50.00) return megayaa.sendMessage(from, {url : thumbnail}, image, {thumbnail: Buffer.alloc(0), caption: `*Youtube Audio Downloader*\n\n📬 *ID :* ${id}\n📜 *Judul :* ${title}\n⏱️ *Durasi :* ${duration}\n🎞️ *Tayangan :* ${view}\n🎥 *Channel :* ${uploader}\n🎁 *Type :* mp3\n💡 *Kualitas :* ${bitrate}\n⚖️ *Size :* ${size}\n📺 *Link channel :* ${channel}\n👍 *Like :* ${like}\n👎 *Dislike :* ${dislike}\n📑 *Deskripsi :* ${description}\n\n*Audio diatas 50 MB, silakan download sendiri :* ${bbb.data.result}`})
await megayaa.sendMessage(from, {url: thumbnail}, image, {thumbnail: Buffer.alloc(0), caption: captin, quoted: lin})
await megayaa.sendMessage(from, {url: link}, audio, {mimetype: "audio/mp4", filename: `${title}.mp3`, quoted: lin})
break
case "ytmp4":
if (!args.length) return reply("Masukan link nya, contoh #ytmp4 link")
var qq = args.join(" ")
var aaa = await axios.get(`https://api.lolhuman.xyz/api/ytvideo?apikey=dikyadis&url=${qq}`)
var { id, title, uploader, channel, duration, view, like, dislike, thumbnail, description } = aaa.data.result
var { link, resolution, size } = aaa.data.result.link
var bbb = await axios.get(`https://megayaa.herokuapp.com/api/short/tiny?url=${link}`)
var captin = `*Youtube Audio Downloader*\n\n📬 *ID :* ${id}\n📜 *Judul :* ${title}\n⏱️ *Durasi :* ${duration}\n🎞️ *Tayangan :* ${view}\n🎥 *Channel :* ${uploader}\n🎁 *Type :* mp3\n💡 *Kualitas :* ${resolution}\n⚖️ *Size :* ${size}\n📺 *Link channel :* ${channel}\n👍 *Like :* ${like}\n👎 *Dislike :* ${dislike}\n📑 *Deskripsi :* ${description}\n\n*Tunggu sebentar audio sedang dikirim*`
if (Number(size.split(' MB')[0]) >= 50.00) return megayaa.sendMessage(from, {url : thumbnail}, image, {thumbnail: Buffer.alloc(0), caption: `*Youtube Audio Downloader*\n\n📬 *ID :* ${id}\n📜 *Judul :* ${title}\n⏱️ *Durasi :* ${duration}\n🎞️ *Tayangan :* ${view}\n🎥 *Channel :* ${uploader}\n🎁 *Type :* mp3\n💡 *Kualitas :* ${resolution}\n⚖️ *Size :* ${size}\n📺 *Link channel :* ${channel}\n👍 *Like :* ${like}\n👎 *Dislike :* ${dislike}\n📑 *Deskripsi :* ${description}\n\n*Audio diatas 50 MB, silakan download sendiri :* ${bbb.data.result}`})
await megayaa.sendMessage(from, {url: thumbnail}, image, {thumbnail: Buffer.alloc(0), caption: captin, quoted: lin})
await megayaa.sendMessage(from, {url: link}, video, {mimetype: "video/mp4", filename: `${title}.mp4`, quoted: lin})
break
case 'wikipedia':
var q = body.slice(11)
var wiki = await axios.get(`https://megayaa.herokuapp.com/api/wikipedia?search=${q}`)
reply(`Hasil pencarin dari ${q}\n\n${wiki.data.wiki}\n\nJika undefined berarti query tidak ditemukan`)
break
case 'kusonime':
try {
q = body.slice(10)
kus = await axios.get(`https://lindow-python-api.herokuapp.com/api/kuso?q=${q}`)
var { info, link_dl, sinopsis, thumb, title } = kus.data
buf = await getBuffer(thumb)
cap = `Title : ${title}\n\n${info}\n\nLink download : ${link_dl}\n\nSinopsis : ${sinopsis}`
megayaa.sendMessage(from, buf, MessageType.image, {caption: cap})
} catch (e) {
console.log(e)
reply(`Anime ${q} tidak ditemukan, coba cari title lain`)
}
break
case 'dewabatch':
try {
q = body.slice(11)
dew = await axios.get(`https://lindow-python-api.herokuapp.com/api/dewabatch?q=${q}`)
var { result, sinopsis, thumb } = dew.data
buffer = await getBuffer(thumb)
cap = `${result}\n\n${sinopsis}`
megayaa.sendMessage(from, buffer, MessageType.image, {caption: cap})
} catch (e) {
console.log(e)
reply(`Anime ${q} tidak dapat ditemukan`)
}
break
case 'pinterest':
megayaa.sendMessage(from, {url: `http://sanz-api.herokuapp.com/api/search/pinterest?q=${args.join(" ")}&apikey=hayuk`, image, {thumbnail: Buffer.alloc(0)})
break
case 'noprefix':
prefix = ''
reply('succes')
break
case 'tinyurl':
url = args.join(" ")
request(`https://tinyurl.com/api-create.php?url=${url}`, function (error, response, body) {
try {
reply(body)
} catch (e) {
reply(e)
}
})
break
case 'gempa':
const tres = await Gempa()
var { Waktu, Lintang, Bujur, Magnitude, Kedalaman, Wilayah, Map } = tres.result
console.log(Map)
captt = `Waktu : ${Waktu}\nLintang : ${Lintang}\nBujur : ${Bujur}\nWilayah : ${Wilayah}`
thumbbb = await getBuffer(Map)
megayaa.sendMessage(from, thumbbb, MessageType.image, {caption: `${captt}`})
break
case 'herolist':
await herolist().then((ress) => {
let hm = `*Menampilkan list hero mobile legends*\n\n`
for (var i = 0; i < ress.hero.length; i++) {
hm += '➣ ' + ress.hero[i] + '\n'
}
reply(hm)
})
break
case 'herodetail':
herodetails(body.slice(12)).then((res) => {
capt = `*Hero details ${body.slice(12)}*
*Nama* : ${res.hero_name}
*Role* : ${res.role}
*Quotes* : ${res.entrance_quotes}
*Fitur Hero* : ${res.hero_feature}
*Spesial* : ${res.speciality}
*Rekomendasi Lane* : ${res.laning_recommendation}
*Harga* : ${res.price.battle_point} (Battle point) | ${res.price.diamond} (Diamond) | ${res.price.hero_fragment} (Hero Fragment)
*Tahun Rilis* : ${res.release_date}
*Skill* :
*Durability* : ${res.skill.durability}
*Offence* : ${res.skill.offense}
*Skill Effect* : ${res.skill_effects}
*Difficulty* : ${res.skill.difficulty}
*Movement Speed* : ${res.attributes.movement_speed}
*Physical Attack* : ${res.attributes.physical_attack}
*Magic Defense* : ${res.attributes.magic_defense}
*Ability Crit Rate* : ${res.attributes.ability_crit_rate}
*HP* : ${res.attributes.hp}
*Mana* : ${res.attributes.mana}
*Mana Regen* : ${res.attributes.mana_regen}
*Story* : ${res.background_story}
`
reply(capt)
})
break
case 'kartundrama':
ress = await Drama()
let megg = `Random Drama Kartun`
for (let i = 0; i < ress.hasil.length; i++) {
megg += `\n\n${ress.hasil[i].sinopsis}\nUrl : ${ress.hasil[i].url}`
}
thumb = await getBuffer(ress.hasil[0].img)
megayaa.sendMessage(from, thumb, MessageType.image, {caption: `${megg}`})
break
case 'kartunadventure':
ress = await Adventure()
let megggg = `Random Adventure Kartun`
for (let i = 0; i < ress.hasil.length; i++) {
megggg += `\n\n${ress.hasil[i].sinopsis}\nUrl : ${ress.hasil[i].link}`
}
thumb = await getBuffer(ress.hasil[0].img)
megayaa.sendMessage(from, thumb, MessageType.image, {caption: `${megggg}`})
break
case 'kartunaction':
ress = await Action()
let meggg = `Random Action Kartun`
for (let i = 0; i < ress.hasil.length; i++) {
meggg += `\n\n${ress.hasil[i].sinopsis}\nUrl : ${ress.hasil[i].link}`
}
thumb = await getBuffer(ress.hasil[0].img)
megayaa.sendMessage(from, thumb, MessageType.image, {caption: `${meggg}`})
break
case 'kartunmovie':
try {
result = await Movie()
let meg = `Random Movie Kartun`
for (let i = 0; i < result.hasil.length; i++) {
meg += `\n\n${result.hasil[i].sinopsis}\nUrl : ${result.hasil[i].url}`
}
thumb = await getBuffer(result.hasil[0].img)
megayaa.sendMessage(from, thumb, MessageType.image, {caption: `${meg}`})
} catch (e) {
console.log(e)
reply(e)
}
break
case 'searchkartun':
film = body.slice(14)
try {
result = await SearchKartun(film)
let hehee = `Search kartun\nQuery : ${film}`
for (let i = 0; i < result.hasil.length; i++) {
hehee += `\n\n${result.hasil[i].sinopsis}\nLink : ${result.hasil[i].link}\nEpisode : ${result.hasil[i].episode}\nGenre : ${result.hasil[i].genre}`
}
thumb = await getBuffer(result.hasil[0].image)
megayaa.sendMessage(from, thumb, MessageType.image, {caption: `${hehee}`})
} catch (e) {
console.log(e)
reply(`Error, Coba judul lain!\n\nExample: ${prefix}searchkartun Spongebob`)
}
break
case 'ayatkursi':
res = await axios.get(`https://lindow-api.herokuapp.com/api/muslim/ayatkursi?apikey=${apikey}`)
var { tafsir, arabic, latin } = res.data.result.data
reply(`Tafsir : ${tafsir}\n\nArabic : ${arabic}\n\nLatin : ${latin}`)
break
case 'kisahnabi':
nama = budy.slice(11)
getres = await axios.get(`https://lindow-api.herokuapp.com/api/kisahnabi?nabi=${nama}&apikey=${apikey}`)
var { nabi, lahir, umur, tempat, kisah } = getres.data.result.nabi
caption = `Kisah Nabi\n\nNama nabi : ${nabi}\n\nLahir pada : ${lahir}\n\nUmur : ${umur}\n\nTempat : ${tempat}\n\nKisah :\n\n${kisah}`
foto = await getBuffer(`${getres.data.result.nabi.image}`)
megayaa.sendMessage(from, foto, MessageType.image, {caption: caption})
break
case 'quoteislam':
quote = await axios.get(`https://lindow-api.herokuapp.com/api/randomquote/muslim?apikey=${apikey}`)
reply(`${quote.data.result.text_id}`)
break
case 'listimage':
teks = '*List Image :*\n\n'
for (let awokwkwk of imagenye) {
teks += `- ${awokwkwk}\n`
}
teks += `\n*Total : ${imagenye.length}*`
megayaa.sendMessage(from, teks.trim(), extendedText, { quoted: lin, contextInfo: { "mentionedJid": imagenye } })
break
case 'getimage':
namastc = body.slice(10)
buffer = fs.readFileSync(`./lib/image/${namastc}.jpeg`)
megayaa.sendMessage(from, buffer, MessageType.image, {quoted: {
key: {
fromMe: false, participant: `0@s.whatsapp.net`, ...(from ? {
remoteJid: "status@broadcast"
}: {})
}, message: { conversation: `Result for database : ${namastc}.jpg` }}})
break
case 'addimage':
if (!isQuotedImage) return reply('reply image!')
svst = body.slice(10)
if (!svst) return reply('input image name!')
boij = JSON.parse(JSON.stringify(lin).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
delb = await megayaa.downloadMediaMessage(boij)
imagenye.push(`${svst}`)
fs.writeFileSync(`./lib/image/${svst}.jpeg`, delb)
fs.writeFileSync('./database/image.json', JSON.stringify(imagenye))
reply(`Success add image\n${prefix}listimage to view list image`)
break
case 'exif':
if (!itsMe) return reply('This command only for lindow')
if (args.length < 1) return reply(`Penggunaan ${prefix}exif nama|autho`)
if (!arg.split('|')) return reply(`Penggunaan ${prefix}exif nama|author`)
exif.create(arg.split('|')[0], arg.split('|')[1])
reply('sukses')
break
case 'takestick':
if (!isQuotedSticker) return reply(`Reply sticker dengan caption *${prefix}takestick nama|author*`)
const pembawm = body.slice(11)
if (!pembawm.includes('|')) return reply(`Reply sticker dengan caption *${prefix}takestick nama|author*`)
const encmedia = JSON.parse(JSON.stringify(lin).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const media = await megayaa.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
const packname = pembawm.split('|')[0]
const author = pembawm.split('|')[1]
exif.create(packname, author, `takestick_${sender}`)
exec(`webpmux -set exif ./sticker/takestick_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return reply('error')
wa.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), lin)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/takestick_${sender}.exif`)
})
break
case 'scdl':
var url = budy.slice(6)
var res = await axios.get(`https://megayaa.herokuapp.com/api/soundcloud?url=${url}`)
var { title, result } = res.data
thumbb = await getBuffer(`${res.data.image}`)
megayaa.sendMessage(from, thumbb, MessageType.image, {caption: `${title}`})
audiony = await getBuffer(result)
megayaa.sendMessage(from, audiony, MessageType.audio, {mimetype: 'audio/mp4', filename: `${title}.mp3`, quoted: lin})
break
case 'ppcouple':
getres = await axios.get(`https://lindow-api.herokuapp.com/api/ppcouple?apikey=${apikey}`)
var { male, female } = getres.data.result
picmale = await getBuffer(`${male}`)
megayaa.sendMessage(from, picmale, image)
picfemale = await getBuffer(`${female}`)
megayaa.sendMessage(from, picfemale, image)
break
case 'randomaesthetic':
url = `https://megayaa.herokuapp.com/api/randomaesthetic`
estetik = await getBuffer(url)
megayaa.sendMessage(from, estetik, MessageType.video, {mimetype: 'video/mp4', filename: `estetod.mp4`, quoted: lin, caption: 'success'})
break
case 'asupan':
url = `https://megayaa.herokuapp.com/api/asupan`
asupan = await getBuffer(url)
megayaa.sendMessage(from, asupan, MessageType.video, {mimetype: 'video/mp4', filename: `asupan.mp4`, quoted: lin, caption: 'success'})
break
case 'igdl':
var ini_url = body.slice(6)
var ini_url2 = await axios.get(`https://lindow-api.herokuapp.com/api/igdl?link=${ini_url}&apikey=${apikey}`)
var ini_url3 = ini_url2.data.result.url
var ini_type = image
if (ini_url3.includes(".mp4")) ini_type = video
var ini_buffer = await getBuffer(ini_url3)
var inicaption = `Username account : ${ini_url2.data.result.username}\n\nCaption : ${ini_url2.data.result.caption}\n\nShortcode : ${ini_url2.data.result.shortcode}\n\nDate : ${ini_url2.data.result.date}`
megayaa.sendMessage(from, ini_buffer, ini_type, {quoted: lin, caption: `${inicaption}`})
break
case 'colong':
if (!isQuotedSticker) return reply(`Reply sticker dengan caption *${prefix}colong*`)
const encmediia = JSON.parse(JSON.stringify(lin).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const meidia = await megayaa.downloadAndSaveMediaMessage(encmediia, `./sticker/${sender}`)
exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return reply('error')
wa.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), lin)
fs.unlinkSync(meidia)
})
break
case 'swm':
case 'stickerwm':
if (isMedia && !lin.message.videoMessage || isQuotedImage) {
if (!arg.includes('|')) return reply(`Kirim gambar atau reply gambar dengan caption *${prefix}stickerwm nama|author*`)
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(lin).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : lin
const media = await megayaa.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
const packname1 = arg.split('|')[0]
const author1 = arg.split('|')[1]
exif.create(packname1, author1, `stickwm_${sender}`)
await ffmpeg(`${media}`)
.input(media)
.on('start', function (cmd) {
console.log(`Started : ${cmd}`)
})
.on('error', function (err) {
console.log(`Error : ${err}`)
fs.unlinkSync(media)
reply('error')
})
.on('end', function () {
console.log('Finish')
exec(`webpmux -set exif ./sticker/stickwm_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return reply('error')
wa.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), lin)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/${sender}.webp`)
fs.unlinkSync(`./sticker/stickwm_${sender}.exif`)
})
})
.addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')