-
Notifications
You must be signed in to change notification settings - Fork 119
/
script.js
2449 lines (2409 loc) · 142 KB
/
script.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
const {
WAConnection,
MessageType,
Presence,
Mimetype,
GroupSettingChange
} = require('@adiwajshing/baileys')
const fs = require("fs")
const FormData = require('form-data')
const request = require('request')
const moment = require('moment-timezone')
const ffmpeg = require('fluent-ffmpeg')
const { apikey, prefix, owner } = JSON.parse(fs.readFileSync('./config.json'))
const { fetchJson, getBuffer } = require('./lib/fetcher')
const { color } = require('./lib/color')
const { exec } = require("child_process")
const { getRandom } = require('./lib/function')
const { help, donate } = require('./help/help')
const { exit } = require('process')
const { default: axios } = require('axios')
// Database
const tebakgambar = JSON.parse(fs.readFileSync('./database/tebakgambar.json'))
const sambungkata = JSON.parse(fs.readFileSync('./database/sambungkata.json'))
const akinator = JSON.parse(fs.readFileSync('./database/akinator.json'))
const afk = JSON.parse(fs.readFileSync('./database/afk.json'))
async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function starts() {
const lolhuman = new WAConnection()
lolhuman.logger.level = 'warn'
lolhuman.version = [2, 2144, 10]
lolhuman.on('qr', () => {
const time_connecting = moment.tz('Asia/Jakarta').format('HH:mm:ss')
console.log(color(time_connecting, "white"), color("[ STATS ]", "aqua"), "Scan QR Code with WhatsApp")
})
fs.existsSync('./lolhuman.json') && lolhuman.loadAuthInfo('./lolhuman.json')
if (apikey == "") {
ini_time = moment.tz('Asia/Jakarta').format('HH:mm:ss')
console.log(color(ini_time, "white"), color("[ ERROR ]", "aqua"), color("Apikey is empty, please check at config.json", 'red'))
exit()
}
lolhuman.on('connecting', () => {
const time_connecting = moment.tz('Asia/Jakarta').format('HH:mm:ss')
console.log(color(time_connecting, "white"), color("[ STATS ]", "aqua"), "Connecting...")
})
lolhuman.on('open', () => {
const time_connect = moment.tz('Asia/Jakarta').format('HH:mm:ss')
console.log(color(time_connect, "white"), color("[ STATS ]", "aqua"), "Connected")
})
await lolhuman.connect({ timeoutMs: 30 * 1000 })
fs.writeFileSync('./lolhuman.json', JSON.stringify(lolhuman.base64EncodedAuthInfo(), null, '\t'))
lolhuman.on('group-participants-update', async(chat) => {
try {
mem = chat.participants[0]
try {
var pp_user = await lolhuman.getProfilePicture(mem)
} catch (e) {
var pp_user = 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png?q=60'
}
try {
var pp_group = await lolhuman.getProfilePicture(chat.jid)
} catch (e) {
var pp_group = 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png?q=60'
}
if (chat.action == 'add') {
ini_user = lolhuman.contacts[mem]
group_info = await lolhuman.groupMetadata(chat.jid)
ini_img = await getBuffer(`https://api.lolhuman.xyz/api/base/welcome?apikey=${apikey}&img1=${pp_user}&img2=${pp_group}&background=https://i.ibb.co/8B6Q84n/LTqHsfYS.jpg&username=${ini_user.notify}&member=${group_info.participants.length}&groupname= ${group_info.subject}`)
welkam = `${ini_user.notify}, Welkam to ${group_info.subject}`
await lolhuman.sendMessage(chat.jid, ini_img, MessageType.image, { caption: welkam })
}
if (chat.action == 'remove') {
ini_user = lolhuman.contacts[mem]
group_info = await lolhuman.groupMetadata(chat.jid)
ini_img = await getBuffer(`https://api.lolhuman.xyz/api/base/leave?apikey=${apikey}&img1=${pp_user}&img2=${pp_group}&background=https://i.ibb.co/8B6Q84n/LTqHsfYS.jpg&username=${ini_user.notify}&member=${group_info.participants.length}&groupname= ${group_info.subject}`)
ini_out = `${ini_user.notify}, Sayonara 👋`
await lolhuman.sendMessage(chat.jid, ini_img, MessageType.image, { caption: welkam })
}
} catch (e) {
console.log('Error :', e)
}
})
lolhuman.on('chat-update', async(lol) => {
try {
const time = moment.tz('Asia/Jakarta').format('HH:mm:ss')
if (!lol.hasNewMessage) return
lol = JSON.parse(JSON.stringify(lol)).messages[0]
if (!lol.message) return
if (lol.key && lol.key.remoteJid == 'status@broadcast') return
if (lol.key.fromMe) return
global.prefix
const content = JSON.stringify(lol.message)
const from = lol.key.remoteJid
const type = Object.keys(lol.message)[0]
const insom = from.endsWith('@g.us')
const nameReq = insom ? lol.participant : lol.key.remoteJid
pushname2 = lolhuman.contacts[nameReq] != undefined ? lolhuman.contacts[nameReq].vname || lolhuman.contacts[nameReq].notify : undefined
const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType
body = (type === 'conversation' && lol.message.conversation.startsWith(prefix)) ? lol.message.conversation : (type == 'imageMessage') && lol.message.imageMessage.caption.startsWith(prefix) ? lol.message.imageMessage.caption : (type == 'videoMessage') && lol.message.videoMessage.caption.startsWith(prefix) ? lol.message.videoMessage.caption : (type == 'extendedTextMessage') && lol.message.extendedTextMessage.text.startsWith(prefix) ? lol.message.extendedTextMessage.text : ''
budy = (type === 'conversation') ? lol.message.conversation : (type === 'extendedTextMessage') ? lol.message.extendedTextMessage.text : ''
var Link = (type === 'conversation' && lol.message.conversation) ? lol.message.conversation : (type == 'imageMessage') && lol.message.imageMessage.caption ? lol.message.imageMessage.caption : (type == 'videoMessage') && lol.message.videoMessage.caption ? lol.message.videoMessage.caption : (type == 'extendedTextMessage') && lol.message.extendedTextMessage.text ? lol.message.extendedTextMessage.text : ''
const messagesLink = Link.slice(0).trim().split(/ +/).shift().toLowerCase()
const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()
const args = body.trim().split(/ +/).slice(1)
const isCmd = body.startsWith(prefix)
lolhuman.chatRead(from)
const mentionByTag = type == "extendedTextMessage" && lol.message.extendedTextMessage.contextInfo != null ? lol.message.extendedTextMessage.contextInfo.mentionedJid : []
const mentionByReply = type == "extendedTextMessage" && lol.message.extendedTextMessage.contextInfo != null ? lol.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 botNumber = lolhuman.user.jid
const isGroup = from.endsWith('@g.us')
const sender = isGroup ? lol.participant : lol.key.remoteJid
const groupMetadata = isGroup ? await lolhuman.groupMetadata(from) : ''
const groupName = isGroup ? groupMetadata.subject : ''
const totalchat = lolhuman.chats.all()
const isUrl = (ini_url) => {
return ini_url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/, 'gi'))
}
const reply = (teks) => {
lolhuman.sendMessage(from, teks, text, { quoted: lol })
}
const sendMess = (hehe, teks) => {
lolhuman.sendMessage(hehe, teks, text)
}
const costum = (pesan, tipe, target, target2) => {
lolhuman.sendMessage(from, pesan, tipe, { quoted: { key: { fromMe: false, participant: `${target}`, ...(from ? { remoteJid: from } : {}) }, message: { conversation: `${target2}` } } })
}
const mentions = (teks, memberr, id) => {
(id == null || id == undefined || id == false) ? lolhuman.sendMessage(from, teks.trim(), extendedText, { contextInfo: { "mentionedJid": memberr } }): lolhuman.sendMessage(from, teks.trim(), extendedText, { quoted: lol, contextInfo: { "mentionedJid": memberr } })
}
async function faketoko(teks, url_image, title, code, price) {
var punya_wa = "[email protected]"
var ini_buffer = await getBuffer(url_image)
const ini_cstoko = {
contextInfo: {
participant: punya_wa,
remoteJid: 'status@broadcast',
quotedMessage: {
productMessage: {
product: {
currencyCode: code,
title: title,
priceAmount1000: price,
productImageCount: 1,
productImage: {
jpegThumbnail: ini_buffer
}
},
businessOwnerJid: "[email protected]"
}
}
}
}
await lolhuman.sendMessage(from, teks, text, ini_cstoko)
}
colors = ['red', 'white', 'black', 'blue', 'yellow', 'green', 'aqua']
const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')
const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')
const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')
const isMedia = isQuotedImage || isQuotedVideo
if (!isGroup && !isCmd) console.log(color(time, "white"), color("[ PRIVATE ]", "aqua"), color(budy, "white"), "from", color(sender.split('@')[0], "yellow"))
if (isGroup && !isCmd) console.log(color(time, "white"), color("[ GROUP ]", "aqua"), color(budy, "white"), "from", color(sender.split('@')[0], "yellow"), "in", color(groupName, "yellow"))
if (!isGroup && isCmd) console.log(color(time, "white"), color("[ COMMAND ]", "aqua"), color(budy, "white"), "from", color(sender.split('@')[0], "yellow"))
if (isGroup && isCmd) console.log(color(time, "white"), color("[ COMMAND ]", "aqua"), color(budy, "white"), "from", color(sender.split('@')[0], "yellow"), "in", color(groupName, "yellow"))
var kuis = false
// AFK
for (let x of mentionUser) {
if (afk.hasOwnProperty(x.split('@')[0])) {
ini_txt = "Maaf user yang anda reply atau tag sedang afk. "
if (afk[x.split('@')[0]] != "") {
ini_txt += "Dengan alasan " + afk[x.split('@')[0]]
}
reply(ini_txt)
}
}
if (afk.hasOwnProperty(sender.split('@')[0])) {
reply("Anda telah keluar dari mode afk.")
delete afk[sender.split('@')[0]]
fs.writeFileSync("./database/afk.json", JSON.stringify(afk))
}
// Tebak Gambar
if (tebakgambar.hasOwnProperty(sender.split('@')[0]) && !isCmd && budy.match(/[1-9]{1}/)) {
kuis = true
jawaban = tebakgambar[sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
reply("Jawaban Anda Benar!")
delete tebakgambar[sender.split('@')[0]]
fs.writeFileSync("./database/tebakgambar.json", JSON.stringify(tebakgambar))
} else {
reply("Jawaban Anda Salah!")
}
}
// Sambung Kata
if (sambungkata.hasOwnProperty(sender.split('@')[0]) && !isCmd) {
kuis = true
jawaban = sambungkata[sender.split('@')[0]]
userAnswer = budy.toLowerCase()
if (userAnswer.startsWith(jawaban[jawaban.length - 1])) {
get_result = await fetchJson(`https://api.lolhuman.xyz/api/sambungkata?apikey=${apikey}&text=${userAnswer}`)
await lolhuman.sendMessage(from, get_result.result, text, { quoted: lol }).then(() => {
sambungkata[sender.split('@')[0]] = get_result.result.toLowerCase()
fs.writeFileSync("./database/sambungkata.json", JSON.stringify(sambungkata))
})
} else {
reply("Silahkan jawab dengan kata yang dimulai huruf " + jawaban[jawaban.length - 1])
}
}
// Akinator
// Premium / VIP apikey only
if (akinator.hasOwnProperty(sender.split('@')[0]) && !isCmd && ["0", "1", "2", "3", "4", "5"].includes(body)) {
kuis = true
var { server, frontaddr, session, signature, question, step } = akinator[sender.split('@')[0]]
if (step == "0" && budy == "5") return reply("Maaf Anda telah mencapai pertanyaan pertama")
var ini_url = `https://api.lolhuman.xyz/api/akinator/answer?apikey=${apikey}&server=${server}&frontaddr=${frontaddr}&session=${session}&signature=${signature}&answer=${budy}&step=${step}`
var get_result = await fetchJson(ini_url)
var get_result = get_result.result
if (get_result.hasOwnProperty("name")) {
var ini_name = get_result.name
var description = get_result.description
var ini_image = get_result.image
var ini_image = await getBuffer(ini_image)
ini_txt = `${ini_name} - ${description}\n\n`
ini_txt += "Sekian dan terima kasih"
await lolhuman.sendMessage(from, ini_image, image, { quoted: lol, caption: ini_txt }).then(() => {
delete akinator[sender.split('@')[0]]
fs.writeFileSync("./database/akinator.json", JSON.stringify(akinator))
})
return
}
var { question, _, step } = get_result
ini_txt = `${question}\n\n`
ini_txt += "0 - Ya\n"
ini_txt += "1 - Tidak\n"
ini_txt += "2 - Saya Tidak Tau\n"
ini_txt += "3 - Mungkin\n"
ini_txt += "4 - Mungkin Tidak\n"
ini_txt += "5 - Kembali ke Pertanyaan Sebelumnya"
if (budy == "5") {
var ini_url = `https://api.lolhuman.xyz/api/akinator/back?apikey=${apikey}&server=${server}&frontaddr=${frontaddr}&session=${session}&signature=${signature}&answer=${budy}&step=${step}`
var get_result = await fetchJson(ini_url)
var get_result = get_result.result
var { question, _, step } = get_result
ini_txt = `${question}\n\n`
ini_txt += "0 - Ya\n"
ini_txt += "1 - Tidak\n"
ini_txt += "2 - Saya Tidak Tau\n"
ini_txt += "3 - Mungkin\n"
ini_txt += "4 - Mungkin Tidak"
ini_txt += "5 - Kembali ke Pertanyaan Sebelumnya"
}
await lolhuman.sendMessage(from, ini_txt, text, { quoted: lol }).then(() => {
const data_ = akinator[sender.split('@')[0]]
data_["question"] = question
data_["step"] = step
akinator[sender.split('@')[0]] = data_
fs.writeFileSync("./database/akinator.json", JSON.stringify(akinator))
})
}
switch (command) {
case 'help':
var punya_wa = "[email protected]"
var ini_text = "api.lolhuman.xyz"
var ini_buffer = await getBuffer("https://i.ibb.co/JdfQ73m/photo-2021-02-05-10-13-39.jpg")
const ini_csreply = {
contextInfo: {
stanzaId: 'B826873620DD5947E683E3ABE663F263',
participant: punya_wa,
remoteJid: 'status@broadcast',
quotedMessage: {
imageMessage: {
caption: ini_text,
jpegThumbnail: ini_buffer
}
}
}
}
await lolhuman.sendMessage(from, help(prefix), text, ini_csreply)
break
case 'donate':
reply(donate(pushname2))
break
case 'clearall':
if (sender.split("@")[0] != owner) return reply("Command only for owner bot")
list_chat = await lolhuman.chats.all()
for (let chat of list_chat) {
lolhuman.modifyChat(chat.jid, "delete")
}
reply("success clear all chat")
break
case 'hidetag':
if (sender.split("@")[0] != owner) return reply("Command only for owner bot")
var value = args.join(" ")
var group = await lolhuman.groupMetadata(from)
var member = group['participants']
var mem = []
member.map(async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
var options = {
text: value,
contextInfo: { mentionedJid: mem },
quoted: lol
}
await lolhuman.sendMessage(from, options, text)
break
case 'tagstick':
if (sender.split("@")[0] != owner) return reply("Command only for owner bot")
if ((isMedia && !lol.message.videoMessage || isQuotedSticker) && args.length == 0) {
const encmedia = isQuotedSticker ? JSON.parse(JSON.stringify(lol).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : lol
filePath = await lolhuman.downloadAndSaveMediaMessage(encmedia, filename = getRandom())
var value = args.join(" ")
var group = await lolhuman.groupMetadata(from)
var member = group['participants']
var mem = []
member.map(async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
var options = {
contextInfo: { mentionedJid: mem },
quoted: lol
}
ini_buffer = fs.readFileSync(filePath)
await lolhuman.sendMessage(from, ini_buffer, sticker, options)
fs.unlinkSync(filePath)
} else {
reply(`Tag sticker yang sudah dikirim`)
}
break
case 'broadcast':
if (sender.split("@")[0] != owner) return reply("Command only for owner bot")
list_chat = await lolhuman.chats.all()
ini_text = args.join(" ")
for (let chat of list_chat) {
sendMess(chat.jid, ini_text)
}
break
case 'afk':
alasan = args.join(" ")
afk[sender.split('@')[0]] = alasan.toLowerCase()
fs.writeFileSync("./database/afk.json", JSON.stringify(afk))
ini_txt = "Anda telah afk. "
if (alasan != "") {
ini_txt += "Dengan alasan " + alasan
}
reply(ini_txt)
break
// Islami //
case 'listsurah':
get_result = await fetchJson(`https://api.lolhuman.xyz/api/quran?apikey=${apikey}`)
get_result = get_result.result
ini_txt = 'List Surah:\n'
for (var x in get_result) {
ini_txt += `${x}. ${get_result[x]}\n`
}
reply(ini_txt)
break
case 'alquran':
if (args.length < 1) return reply(`Example: ${prefix + command} 18 or ${prefix + command} 18/10 or ${prefix + command} 18/1-10`)
urls = `https://api.lolhuman.xyz/api/quran/${args[0]}?apikey=${apikey}`
quran = await fetchJson(urls)
result = quran.result
ayat = result.ayat
ini_txt = `QS. ${result.surah} : 1-${ayat.length}\n\n`
for (var x of ayat) {
arab = x.arab
nomor = x.ayat
latin = x.latin
indo = x.indonesia
ini_txt += `${arab}\n${nomor}. ${latin}\n${indo}\n\n`
}
ini_txt = ini_txt.replace(/<u>/g, "").replace(/<\/u>/g, "")
ini_txt = ini_txt.replace(/<strong>/g, "").replace(/<\/strong>/g, "")
ini_txt = ini_txt.replace(/<u>/g, "").replace(/<\/u>/g, "")
reply(ini_txt)
break
case 'alquranaudio':
if (args.length == 0) return reply(`Example: ${prefix + command} 18 or ${prefix + command} 18/10`)
surah = args[0]
ini_buffer = await getBuffer(`https://api.lolhuman.xyz/api/quran/audio/${surah}?apikey=${apikey}`)
await lolhuman.sendMessage(from, ini_buffer, audio, { quoted: lol, mimetype: Mimetype.mp4Audio })
break
case 'asmaulhusna':
get_result = await fetchJson(`https://api.lolhuman.xyz/api/asmaulhusna?apikey=${apikey}`)
get_result = get_result.result
ini_txt = `No : ${get_result.index}\n`
ini_txt += `Latin: ${get_result.latin}\n`
ini_txt += `Arab : ${get_result.ar}\n`
ini_txt += `Indonesia : ${get_result.id}\n`
ini_txt += `English : ${get_result.en}`
reply(ini_txt)
break
case 'kisahnabi':
if (args.length == 0) return reply(`Example: ${prefix + command} Muhammad`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/kisahnabi/${query}?apikey=${apikey}`)
get_result = get_result.result
ini_txt = `Name : ${get_result.name}\n`
ini_txt += `Lahir : ${get_result.thn_kelahiran}\n`
ini_txt += `Umur : ${get_result.age}\n`
ini_txt += `Tempat : ${get_result.place}\n`
ini_txt += `Story : \n${get_result.story}`
reply(ini_txt)
break
case 'jadwalsholat':
if (args.length == 0) return reply(`Example: ${prefix + command} Yogyakarta`)
daerah = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/sholat/${daerah}?apikey=${apikey}`)
get_result = get_result.result
ini_txt = `Wilayah : ${get_result.wilayah}\n`
ini_txt += `Tanggal : ${get_result.tanggal}\n`
ini_txt += `Sahur : ${get_result.sahur}\n`
ini_txt += `Imsak : ${get_result.imsak}\n`
ini_txt += `Subuh : ${get_result.subuh}\n`
ini_txt += `Terbit : ${get_result.terbit}\n`
ini_txt += `Dhuha : ${get_result.dhuha}\n`
ini_txt += `Dzuhur : ${get_result.dzuhur}\n`
ini_txt += `Ashar : ${get_result.ashar}\n`
ini_txt += `Maghrib : ${get_result.imsak}\n`
ini_txt += `Isya : ${get_result.isya}`
reply(ini_txt)
break
// Downloader //
case 'ytplay':
if (args.length == 0) return await reply(`Example: ${prefix + command} melukis senja`)
await fetchJson(`https://api.lolhuman.xyz/api/ytsearch?apikey=${apikey}&query=${args.join(" ")}`)
.then(async(result) => {
await fetchJson(`https://api.lolhuman.xyz/api/ytaudio2?apikey=${apikey}&url=https://www.youtube.com/watch?v=${result.result[0].videoId}`)
.then(async(result) => {
result = result.result
caption = `❖ Title : *${result.title}*\n`
caption += `❖ Size : *${result.size}*`
ini_buffer = await getBuffer(result.thumbnail)
await lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol, caption: caption })
get_audio = await getBuffer(result.link)
await lolhuman.sendMessage(from, get_audio, audio, { mimetype: 'audio/mp4', filename: `${result.title}.mp3`, quoted: lol })
})
})
break
case 'ytsearch':
if (args.length == 0) return reply(`Example: ${prefix + command} Melukis Senja`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/ytsearch?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = ""
for (var x of get_result) {
ini_txt += `Title : ${x.title}\n`
ini_txt += `Views : ${x.views}\n`
ini_txt += `Published : ${x.published}\n`
ini_txt += `Thumbnail : ${x.thumbnail}\n`
ini_txt += `Link : https://www.youtube.com/watch?v=${x.videoId}\n\n`
}
reply(ini_txt)
break
case 'ytmp3':
if (args.length == 0) return reply(`Example: ${prefix + command} https://www.youtube.com/watch?v=qZIQAk-BUEc`)
ini_link = args[0]
get_result = await fetchJson(`https://api.lolhuman.xyz/api/ytaudio2?apikey=${apikey}&url=${ini_link}`)
get_result = get_result.result
caption = `❖ Title : *${result.title}*\n`
caption += `❖ Size : *${result.size}*`
ini_buffer = await getBuffer(get_result.thumbnail)
await lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol, caption: ini_txt })
get_audio = await getBuffer(get_result.link)
await lolhuman.sendMessage(from, get_audio, audio, { mimetype: 'audio/mp4', filename: `${get_result.title}.mp3`, quoted: lol })
break
case 'ytmp4':
if (args.length == 0) return reply(`Example: ${prefix + command} https://www.youtube.com/watch?v=qZIQAk-BUEc`)
ini_link = args[0]
get_result = await fetchJson(`https://api.lolhuman.xyz/api/ytvideo2?apikey=${apikey}&url=${ini_link}`)
get_result = get_result.result
ini_txt = `${get_result.title} - ${get_result.size}`
ini_buffer = await getBuffer(get_result.thumbnail)
await lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol, caption: ini_txt })
get_audio = await getBuffer(get_result.link)
await lolhuman.sendMessage(from, get_audio, video, { mimetype: 'video/mp4', filename: `${get_result.title}.mp4`, quoted: lol })
break
case 'telesticker':
if (args.length == 0) return reply(`Example: ${prefix + command} https://t.me/addstickers/LINE_Menhera_chan_ENG`)
ini_url = args[0]
ini_url = await fetchJson(`https://api.lolhuman.xyz/api/telestick?apikey=${apikey}&url=${ini_url}`)
ini_sticker = ini_url.result.sticker
for (sticker_ in ini_sticker) {
ini_buffer = await getBuffer(ini_sticker[sticker_])
await lolhuman.sendMessage(from, ini_buffer, sticker)
}
break
case 'tiktoknowm':
if (args.length == 0) return reply(`Example: ${prefix + command} https://vt.tiktok.com/ZSwWCk5o/`)
ini_url = args[0]
ini_url = `https://api.lolhuman.xyz/api/tiktok?apikey=${apikey}&url=${ini_url}`
get_result = await fetchJson(ini_url)
ini_buffer = await getBuffer(get_result.result.link)
await lolhuman.sendMessage(from, ini_buffer, video, { quoted: lol })
break
case 'tiktokmusic':
if (args.length == 0) return reply(`Example: ${prefix + command} https://vt.tiktok.com/ZSwWCk5o/`)
ini_link = args[0]
get_audio = await getBuffer(`https://api.lolhuman.xyz/api/tiktokmusic?apikey=${apikey}&url=${ini_link}`)
await lolhuman.sendMessage(from, get_audio, audio, { mimetype: Mimetype.mp4Audio, quoted: lol })
break
case 'spotify':
if (args.length == 0) return reply(`Example: ${prefix + command} https://open.spotify.com/track/0ZEYRVISCaqz5yamWZWzaA`)
url = args[0]
get_result = await fetchJson(`https://api.lolhuman.xyz/api/spotify?apikey=${apikey}&url=${url}`)
get_result = get_result.result
ini_txt = `Title : ${get_result.title}\n`
ini_txt += `Artists : ${get_result.artists}\n`
ini_txt += `Duration : ${get_result.duration}\n`
ini_txt += `Popularity : ${get_result.popularity}\n`
ini_txt += `Preview : ${get_result.preview_url}\n`
thumbnail = await getBuffer(get_result.thumbnail)
await lolhuman.sendMessage(from, thumbnail, image, { quoted: lol, caption: ini_txt })
get_audio = await getBuffer(get_result.link)
await lolhuman.sendMessage(from, get_audio, audio, { mimetype: 'audio/mp4', filename: `${get_result.title}.mp3`, quoted: lol })
break
case 'spotifysearch':
if (args.length == 0) return reply(`Example: ${prefix + command} Melukis Senja`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/spotifysearch?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = ""
for (var x of get_result) {
ini_txt += `Title : ${x.title}\n`
ini_txt += `Artists : ${x.artists}\n`
ini_txt += `Duration : ${x.duration}\n`
ini_txt += `Link : ${x.link}\n`
ini_txt += `Preview : ${x.preview_url}\n\n\n`
}
reply(ini_txt)
break
case 'jooxplay':
if (args.length == 0) return reply(`Example: ${prefix + command} Melukis Senja`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/jooxplay?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = `Title : ${get_result.info.song}\n`
ini_txt += `Artists : ${get_result.info.singer}\n`
ini_txt += `Duration : ${get_result.info.duration}\n`
ini_txt += `Album : ${get_result.info.album}\n`
ini_txt += `Uploaded : ${get_result.info.date}\n`
ini_txt += `Lirik :\n ${get_result.lirik}\n`
thumbnail = await getBuffer(get_result.image)
await lolhuman.sendMessage(from, thumbnail, image, { quoted: lol, caption: ini_txt })
get_audio = await getBuffer(get_result.audio[0].link)
await lolhuman.sendMessage(from, get_audio, audio, { mimetype: 'audio/mp4', filename: `${get_result.info.song}.mp3`, quoted: lol })
break
case 'igdl':
if (args.length == 0) return reply(`Example: ${prefix + command} https://www.instagram.com/p/CJ8XKFmJ4al/?igshid=1acpcqo44kgkn`)
ini_url = args[0]
ini_url = await fetchJson(`https://api.lolhuman.xyz/api/instagram?apikey=${apikey}&url=${ini_url}`)
ini_url = ini_url.result
ini_type = image
if (ini_url.includes(".mp4")) ini_type = video
ini_buffer = await getBuffer(ini_url)
await lolhuman.sendMessage(from, ini_buffer, ini_type, { quoted: lol })
break
case 'igdl2':
if (args.length == 0) return reply(`Example: ${prefix + command} https://www.instagram.com/p/CJ8XKFmJ4al/?igshid=1acpcqo44kgkn`)
ini_url = args[0]
ini_url = await fetchJson(`https://api.lolhuman.xyz/api/instagram2?apikey=${apikey}&url=${ini_url}`)
ini_result = ini_url.result.media
for (var x of ini_result) {
ini_type = image
if (x.includes(".mp4")) ini_type = video
ini_buffer = await getBuffer(x)
await lolhuman.sendMessage(from, ini_buffer, ini_type, { quoted: lol })
}
break
case 'twtdl':
if (args.length == 0) return reply(`Example: ${prefix + command} https://twitter.com/gofoodindonesia/status/1229369819511709697`)
ini_url = args[0]
ini_url = await fetchJson(`https://api.lolhuman.xyz/api/twitter?apikey=${apikey}&url=${ini_url}`)
ini_url = ini_url.result
ini_url = ini_url[ini_url.length - 1].link
ini_buffer = await getBuffer(ini_url)
await lolhuman.sendMessage(from, ini_buffer, video, { quoted: lol })
break
case 'fbdl':
if (args.length == 0) return reply(`Example: ${prefix + command} https://id-id.facebook.com/SamsungGulf/videos/video-bokeh/561108457758458/`)
ini_url = args[0]
ini_url = await fetchJson(`https://api.lolhuman.xyz/api/facebook?apikey=${apikey}&url=${ini_url}`)
ini_url = ini_url.result[0].link
ini_buffer = await getBuffer(ini_url)
await lolhuman.sendMessage(from, ini_buffer, video, { quoted: lol })
break
case 'zippyshare':
if (args.length == 0) return reply(`Example: ${prefix + command} https://www51.zippyshare.com/v/5W0TOBz1/file.html`)
ini_url = args[0]
ini_url = await fetchJson(`https://api.lolhuman.xyz/api/zippyshare?apikey=${apikey}&url=${ini_url}`)
ini_url = ini_url.result
ini_txt = `File Name : ${ini_url.name_file}\n`
ini_txt += `Size : ${ini_url.size}\n`
ini_txt += `Date Upload : ${ini_url.date_upload}\n`
ini_txt += `Download Url : ${ini_url.download_url}`
reply(ini_txt)
break
case 'pinterest':
if (args.length == 0) return reply(`Example: ${prefix + command} loli kawaii`)
query = args.join(" ")
ini_url = await fetchJson(`https://api.lolhuman.xyz/api/pinterest?apikey=${apikey}&query=${query}`)
ini_url = ini_url.result
ini_buffer = await getBuffer(ini_url)
await lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol })
break
case 'pinterest2':
if (args.length == 0) return reply(`Example: ${prefix + command} loli kawaii`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/pinterest2?apikey=${apikey}&query=${query}`)
get_result = get_result.result
for (var x = 0; x <= 5; x++) {
var ini_buffer = await getBuffer(get_result[x])
await lolhuman.sendMessage(from, ini_buffer, image)
}
break
case 'pinterestdl':
if (args.length == 0) return reply(`Example: ${prefix + command} https://id.pinterest.com/pin/696580267364426905/`)
ini_url = args[0]
ini_url = await fetchJson(`https://api.lolhuman.xyz/api/pinterestdl?apikey=${apikey}&url=${ini_url}`)
ini_url = ini_url.result[0]
ini_buffer = await getBuffer(ini_url)
await lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol })
break
case 'pixiv':
if (args.length == 0) return reply(`Example: ${prefix + command} loli kawaii`)
query = args.join(" ")
ini_buffer = await getBuffer(`https://api.lolhuman.xyz/api/pixiv?apikey=${apikey}&query=${query}`)
await lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol })
break
case 'pixivdl':
if (args.length == 0) return reply(`Example: ${prefix + command} 63456028`)
query = args[0]
ini_buffer = await getBuffer(`https://api.lolhuman.xyz/api/pixivdl/${pixivid}?apikey=${apikey}`)
await lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol })
break
case 'xhamstersearch':
if (args.length == 0) return reply(`Example: ${prefix + command} Japanese`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/xhamstersearch?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = ""
for (var x of get_result) {
ini_txt += `Title : ${x.title}\n`
ini_txt += `Views : ${x.views}\n`
ini_txt += `Duration : ${x.duration}\n`
ini_txt += `Link : ${x.link}\n\n`
}
reply(ini_txt)
break
case 'xhamster':
if (args.length == 0) return reply(`Example: ${prefix + command} https://xhamster.com/videos/party-with-friends-end-in-awesome-fucking-5798407`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/xhamster?apikey=${apikey}&url=${query}`)
get_result = get_result.result
ini_txt = `Title : ${get_result.title}\n`
ini_txt += `Duration : ${get_result.duration}\n`
ini_txt += `Uploader : ${get_result.author}\n`
ini_txt += `Upload : ${get_result.upload}\n`
ini_txt += `View : ${get_result.views}\n`
ini_txt += `Rating : ${get_result.rating}\n`
ini_txt += `Like : ${get_result.likes}\n`
ini_txt += `Dislike : ${get_result.dislikes}\n`
ini_txt += `Comment : ${get_result.comments}\n`
ini_txt += "Link : \n"
link = get_result.link
for (var x of link) {
ini_txt += `${x.type} - ${x.link}\n\n`
}
thumbnail = await getBuffer(get_result.thumbnail)
await lolhuman.sendMessage(from, thumbnail, image, { quoted: lol, caption: ini_txt })
break
case 'xnxxsearch':
if (args.length == 0) return reply(`Example: ${prefix + command} Japanese`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/xnxxsearch?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = ""
for (var x of get_result) {
ini_txt += `Title : ${x.title}\n`
ini_txt += `Views : ${x.views}\n`
ini_txt += `Duration : ${x.duration}\n`
ini_txt += `Uploader : ${x.uploader}\n`
ini_txt += `Link : ${x.link}\n`
ini_txt += `Thumbnail : ${x.thumbnail}\n\n`
}
reply(ini_txt)
break
case 'xnxx':
if (args.length == 0) return reply(`Example: ${prefix + command} https://www.xnxx.com/video-uy5a73b/mom_is_horny_-_brooklyn`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/xnxx?apikey=${apikey}&url=${query}`)
get_result = get_result.result
ini_txt = `Title : ${get_result.title}\n`
ini_txt += `Duration : ${get_result.duration}\n`
ini_txt += `View : ${get_result.view}\n`
ini_txt += `Rating : ${get_result.rating}\n`
ini_txt += `Like : ${get_result.like}\n`
ini_txt += `Dislike : ${get_result.dislike}\n`
ini_txt += `Comment : ${get_result.comment}\n`
ini_txt += `Tag : ${get_result.tag.join(", ")}\n`
ini_txt += `Description : ${get_result.description}\n`
ini_txt += "Link : \n"
ini_link = get_result.link
for (var x of ini_link) {
ini_txt += `${x.type} - ${x.link}\n\n`
}
thumbnail = await getBuffer(get_result.thumbnail)
await lolhuman.sendMessage(from, thumbnail, image, { quoted: lol, caption: ini_txt })
break
// AniManga //
case 'character':
if (args.length == 0) return reply(`Example: ${prefix + command} Miku Nakano`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/character?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = `Id : ${get_result.id}\n`
ini_txt += `Name : ${get_result.name.full}\n`
ini_txt += `Native : ${get_result.name.native}\n`
ini_txt += `Favorites : ${get_result.favourites}\n`
ini_txt += `Media : \n`
ini_media = get_result.media.nodes
for (var x of ini_media) {
ini_txt += `- ${x.title.romaji} (${x.title.native})\n`
}
ini_txt += `\nDescription : \n${get_result.description.replace(/__/g, "_")}`
thumbnail = await getBuffer(get_result.image.large)
await lolhuman.sendMessage(from, thumbnail, image, { quoted: lol, caption: ini_txt })
break
case 'manga':
if (args.length == 0) return reply(`Example: ${prefix + command} Gotoubun No Hanayome`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/manga?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = `Id : ${get_result.id}\n`
ini_txt += `Id MAL : ${get_result.idMal}\n`
ini_txt += `Title : ${get_result.title.romaji}\n`
ini_txt += `English : ${get_result.title.english}\n`
ini_txt += `Native : ${get_result.title.native}\n`
ini_txt += `Format : ${get_result.format}\n`
ini_txt += `Chapters : ${get_result.chapters}\n`
ini_txt += `Volume : ${get_result.volumes}\n`
ini_txt += `Status : ${get_result.status}\n`
ini_txt += `Source : ${get_result.source}\n`
ini_txt += `Start Date : ${get_result.startDate.day} - ${get_result.startDate.month} - ${get_result.startDate.year}\n`
ini_txt += `End Date : ${get_result.endDate.day} - ${get_result.endDate.month} - ${get_result.endDate.year}\n`
ini_txt += `Genre : ${get_result.genres.join(", ")}\n`
ini_txt += `Synonyms : ${get_result.synonyms.join(", ")}\n`
ini_txt += `Score : ${get_result.averageScore}%\n`
ini_txt += `Characters : \n`
ini_character = get_result.characters.nodes
for (var x of ini_character) {
ini_txt += `- ${x.name.full} (${x.name.native})\n`
}
ini_txt += `\nDescription : ${get_result.description}`
thumbnail = await getBuffer(get_result.coverImage.large)
await lolhuman.sendMessage(from, thumbnail, image, { quoted: lol, caption: ini_txt })
break
case 'anime':
if (args.length == 0) return reply(`Example: ${prefix + command} Gotoubun No Hanayome`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/anime?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = `Id : ${get_result.id}\n`
ini_txt += `Id MAL : ${get_result.idMal}\n`
ini_txt += `Title : ${get_result.title.romaji}\n`
ini_txt += `English : ${get_result.title.english}\n`
ini_txt += `Native : ${get_result.title.native}\n`
ini_txt += `Format : ${get_result.format}\n`
ini_txt += `Episodes : ${get_result.episodes}\n`
ini_txt += `Duration : ${get_result.duration} mins.\n`
ini_txt += `Status : ${get_result.status}\n`
ini_txt += `Season : ${get_result.season}\n`
ini_txt += `Season Year : ${get_result.seasonYear}\n`
ini_txt += `Source : ${get_result.source}\n`
ini_txt += `Start Date : ${get_result.startDate.day} - ${get_result.startDate.month} - ${get_result.startDate.year}\n`
ini_txt += `End Date : ${get_result.endDate.day} - ${get_result.endDate.month} - ${get_result.endDate.year}\n`
ini_txt += `Genre : ${get_result.genres.join(", ")}\n`
ini_txt += `Synonyms : ${get_result.synonyms.join(", ")}\n`
ini_txt += `Score : ${get_result.averageScore}%\n`
ini_txt += `Characters : \n`
ini_character = get_result.characters.nodes
for (var x of ini_character) {
ini_txt += `- ${x.name.full} (${x.name.native})\n`
}
ini_txt += `\nDescription : ${get_result.description}`
thumbnail = await getBuffer(get_result.coverImage.large)
await lolhuman.sendMessage(from, thumbnail, image, { quoted: lol, caption: ini_txt })
break
case 'wait':
if ((isMedia && !lol.message.videoMessage || isQuotedImage) && args.length == 0) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(lol).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : lol
const filebuffer = await lolhuman.downloadMediaMessage(encmedia);
const form = new FormData();
form.append('img', filebuffer, { filename: 'tahu.jpg' })
get_result = await axios.post(`https://api.lolhuman.xyz/api/wait?apikey=${apikey}`, form.getBuffer(), { headers: { "content-type": `multipart/form-data; boundary=${form._boundary}` } })
get_result = get_result.data.result
ini_txt = `Anilist id : ${get_result.anilist_id}\n`
ini_txt += `MAL id : ${get_result.mal_id}\n`
ini_txt += `Title Romaji : ${get_result.title_romaji}\n`
ini_txt += `Title Native : ${get_result.title_native}\n`
ini_txt += `Title English : ${get_result.title_english}\n`
ini_txt += `at : ${get_result.at}\n`
ini_txt += `Episode : ${get_result.episode}\n`
ini_txt += `Similarity : ${get_result.similarity}`
await lolhuman.sendMessage(from, { url: get_result.video }, video, { quoted: lol, caption: ini_txt })
} else {
reply(`Kirim gambar dengan caption ${prefix + command} atau tag gambar yang sudah dikirim`)
}
break
case 'kusonime':
if (args.length == 0) return reply(`Example: ${prefix + command} https://kusonime.com/nanatsu-no-taizai-bd-batch-subtitle-indonesia/`)
ini_url = args[0]
get_result = await fetchJson(`https://api.lolhuman.xyz/api/kusonime?apikey=${apikey}&url=${ini_url}`)
get_result = get_result.result
ini_txt = `Title : ${get_result.title}\n`
ini_txt += `Japanese : ${get_result.japanese}\n`
ini_txt += `Genre : ${get_result.genre}\n`
ini_txt += `Seasons : ${get_result.seasons}\n`
ini_txt += `Producers : ${get_result.producers}\n`
ini_txt += `Type : ${get_result.type}\n`
ini_txt += `Status : ${get_result.status}\n`
ini_txt += `Total Episode : ${get_result.total_episode}\n`
ini_txt += `Score : ${get_result.score}\n`
ini_txt += `Duration : ${get_result.duration}\n`
ini_txt += `Released On : ${get_result.released_on}\n`
ini_txt += `Desc : ${get_result.desc}\n`
link_dl = get_result.link_dl
for (var x in link_dl) {
ini_txt += `\n${x}\n`
for (var y in link_dl[x]) {
ini_txt += `${y} - ${link_dl[x][y]}\n`
}
}
ini_buffer = await getBuffer(get_result.thumbnail)
await lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol, caption: ini_txt })
break
case 'kusonimesearch':
if (args.length == 0) return reply(`Example: ${prefix + command} Gotoubun No Hanayome`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/kusonimesearch?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = `Title : ${get_result.title}\n`
ini_txt += `Japanese : ${get_result.japanese}\n`
ini_txt += `Genre : ${get_result.genre}\n`
ini_txt += `Seasons : ${get_result.seasons}\n`
ini_txt += `Producers : ${get_result.producers}\n`
ini_txt += `Type : ${get_result.type}\n`
ini_txt += `Status : ${get_result.status}\n`
ini_txt += `Total Episode : ${get_result.total_episode}\n`
ini_txt += `Score : ${get_result.score}\n`
ini_txt += `Duration : ${get_result.duration}\n`
ini_txt += `Released On : ${get_result.released_on}\n`
ini_txt += `Desc : ${get_result.desc}\n`
link_dl = get_result.link_dl
for (var x in link_dl) {
ini_txt += `\n${x}\n`
for (var y in link_dl[x]) {
ini_txt += `${y} - ${link_dl[x][y]}\n`
}
}
ini_buffer = await getBuffer(get_result.thumbnail)
await lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol, caption: ini_txt })
break
case 'otakudesu':
if (args.length == 0) return reply(`Example: ${prefix + command} https://otakudesu.tv/lengkap/pslcns-sub-indo/`)
ini_url = args[0]
get_result = await fetchJson(`https://api.lolhuman.xyz/api/otakudesu?apikey=${apikey}&url=${ini_url}`)
get_result = get_result.result
ini_txt = `Title : ${get_result.title}\n`
ini_txt += `Japanese : ${get_result.japanese}\n`
ini_txt += `Judul : ${get_result.judul}\n`
ini_txt += `Type : ${get_result.type}\n`
ini_txt += `Episode : ${get_result.episodes}\n`
ini_txt += `Aired : ${get_result.aired}\n`
ini_txt += `Producers : ${get_result.producers}\n`
ini_txt += `Genre : ${get_result.genres}\n`
ini_txt += `Duration : ${get_result.duration}\n`
ini_txt += `Studios : ${get_result.status}\n`
ini_txt += `Rating : ${get_result.rating}\n`
ini_txt += `Credit : ${get_result.credit}\n`
get_link = get_result.link_dl
for (var x in get_link) {
ini_txt += `\n\n*${get_link[x].title}*\n`
for (var y in get_link[x].link_dl) {
ini_info = get_link[x].link_dl[y]
ini_txt += `\n\`\`\`Reso : \`\`\`${ini_info.reso}\n`
ini_txt += `\`\`\`Size : \`\`\`${ini_info.size}\n`
ini_txt += `\`\`\`Link : \`\`\`\n`
down_link = ini_info.link_dl
for (var z in down_link) {
ini_txt += `${z} - ${down_link[z]}\n`
}
}
}
reply(ini_txt)
break
case 'otakudesusearch':
if (args.length == 0) return reply(`Example: ${prefix + command} Gotoubun No Hanayome`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/otakudesusearch?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = `Title : ${get_result.title}\n`
ini_txt += `Japanese : ${get_result.japanese}\n`
ini_txt += `Judul : ${get_result.judul}\n`
ini_txt += `Type : ${get_result.type}\n`
ini_txt += `Episode : ${get_result.episodes}\n`
ini_txt += `Aired : ${get_result.aired}\n`
ini_txt += `Producers : ${get_result.producers}\n`
ini_txt += `Genre : ${get_result.genres}\n`
ini_txt += `Duration : ${get_result.duration}\n`
ini_txt += `Studios : ${get_result.status}\n`
ini_txt += `Rating : ${get_result.rating}\n`
ini_txt += `Credit : ${get_result.credit}\n`
get_link = get_result.link_dl
for (var x in get_link) {
ini_txt += `\n\n*${get_link[x].title}*\n`
for (var y in get_link[x].link_dl) {
ini_info = get_link[x].link_dl[y]
ini_txt += `\n\`\`\`Reso : \`\`\`${ini_info.reso}\n`
ini_txt += `\`\`\`Size : \`\`\`${ini_info.size}\n`
ini_txt += `\`\`\`Link : \`\`\`\n`
down_link = ini_info.link_dl
for (var z in down_link) {
ini_txt += `${z} - ${down_link[z]}\n`
}
}
}
reply(ini_txt)
break
case 'nhentai':
if (args.length == 0) return reply(`Example: ${prefix + command} 344253`)
henid = args[0]
get_result = await fetchJson(`https://api.lolhuman.xyz/api/nhentai/${henid}?apikey=${apikey}`)
get_result = get_result.result
ini_txt = `Title Romaji : ${get_result.title_romaji}\n`
ini_txt += `Title Native : ${get_result.title_native}\n`
ini_txt += `Read Online : ${get_result.read}\n`
get_info = get_result.info
ini_txt += `Parodies : ${get_info.parodies}\n`
ini_txt += `Character : ${get_info.characters.join(", ")}\n`
ini_txt += `Tags : ${get_info.tags.join(", ")}\n`
ini_txt += `Artist : ${get_info.artists}\n`
ini_txt += `Group : ${get_info.groups}\n`
ini_txt += `Languager : ${get_info.languages.join(", ")}\n`
ini_txt += `Categories : ${get_info.categories}\n`
ini_txt += `Pages : ${get_info.pages}\n`
ini_txt += `Uploaded : ${get_info.uploaded}\n`
reply(ini_txt)
break
case 'nhentaipdf':
if (args.length == 0) return reply(`Example: ${prefix + command} 344253`)
henid = args[0]
get_result = await fetchJson(`https://api.lolhuman.xyz/api/nhentaipdf/${henid}?apikey=${apikey}`)
get_result = get_result.result
ini_buffer = await getBuffer(get_result)
await lolhuman.sendMessage(from, ini_buffer, document, { quoted: lol, mimetype: Mimetype.pdf, filename: `${henid}.pdf` })
break
case 'nhentaisearch':
if (args.length == 0) return reply(`Example: ${prefix + command} Gotoubun No Hanayome`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/nhentaisearch?apikey=${apikey}&query=${query}`)
get_result = get_result.result
ini_txt = "Result : \n"
for (var x of get_result) {
ini_txt += `Id : ${x.id}\n`
ini_txt += `Title English : ${x.title_english}\n`
ini_txt += `Title Japanese : ${x.title_japanese}\n`
ini_txt += `Native : ${x.title_native}\n`
ini_txt += `Upload : ${x.date_upload}\n`
ini_txt += `Page : ${x.page}\n`
ini_txt += `Favourite : ${x.favourite}\n\n`
}
reply(ini_txt)
break