-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path+api.js
2153 lines (2058 loc) · 95.1 KB
/
+api.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
/*
# elaina - UserBot
# Credit Sc Ori By ZeeoneOfc
# Subscribe Yt RflBotz Ofc
# This file is a part of < https://github.com/zeeoneofc/elaina/ >
*/
// WhatsApp api
require('../settings/config.js')
const
{
WAConnection,
MessageType,
Presence,
MessageOptions,
Mimetype,
WALocationMessage,
WA_MESSAGE_STUB_TYPES,
WA_DEFAULT_EPHEMERAL,
ReconnectMode,
ProxyAgent,
GroupSettingChange,
waChatKey,
mentionedJid,
processTime,
} = require("@adiwajshing/baileys")
//module exports
const axios = require("axios")
const chalk = require('chalk')
const { exec, spawn, execSync } = require("child_process")
const crypto = require('crypto')
const { EmojiAPI } = require("emoji-api");
const emoji = new EmojiAPI()
const fetch = require('node-fetch');
const ffmpeg = require('fluent-ffmpeg')
const figlet = require('figlet')
const fs = require('fs')
const gis = require('g-i-s')
const hx = require('hxz-api')
const ms = require('parse-ms')
const moment = require('moment-timezone')
const request = require('request')
const speed = require('performance-now')
const util = require('util')
const yts = require( 'yt-search')
const ytdl = require("ytdl-core")
const zee = require('api-alphabot')
//library
const { simih, getBuffer, h2k, generateMessageID, getGroupAdmins, getRandom, banner, start, info, success, close } = require('../lib/functions')
const { fetchJson, kyun, fetchText } = require('../lib/fetcher')
const { color, bgcolor } = require('../lib/color')
const { yta, ytv} = require('../lib/y2mate')
const simple = require('../lib/simple')
const { uploadImages } = require('../lib/uploadimage')
//json
const antilink = JSON.parse(fs.readFileSync('./database/group/antilink.json'))
const _registered = JSON.parse(fs.readFileSync('./database/user/registered.json'))
const _limit = JSON.parse(fs.readFileSync('./database/user/limit.json'))
const premium = JSON.parse(fs.readFileSync('./database/user/premium.json'))
const { getRegisterNo, getRegisterName, getRegisterSerial, getRegisterAge, getRegisterTime, getRegisteredRandomId, addRegisteredUser, createSerial, checkRegisteredUser } = require('../database/user/register.js')
const tebakgambar = JSON.parse(fs.readFileSync('./database/game/tebakgambar.json'))
const siapakahaku = JSON.parse(fs.readFileSync('./src/siapakahaku.json'))
/*
# language
# available now [ind]
*/
const { ind } = require(`./help`)
lang = ind
//times
const time = moment(Date.now()).tz('Asia/Jakarta').locale('id').format('HH:mm:ss z')
const salam = moment(Date.now()).tz('Asia/Jakarta').locale('id').format('a')
module.exports = elaina = async (elaina, mek) => {
try {
if (!mek.hasNewMessage) return
mek = mek.messages.all()[0]
if (!mek.message) return
if (mek.key && mek.key.remoteJid == 'status@broadcast') return
mek.message = (Object.keys(mek.message)[0] === 'ephemeralMessage') ? mek.message.ephemeralMessage.message : mek.message
const content = JSON.stringify(mek.message)
const from = mek.key.remoteJid
const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType
const wita = moment(Date.now()).tz('Asia/Makassar').locale('id').format('HH:mm:ss z')
const wit = moment(Date.now()).tz('Asia/Jayapura').locale('id').format('HH:mm:ss z')
const type = Object.keys(mek.message)[0]
const cmd = (type === 'conversation' && mek.message.conversation) ? mek.message.conversation : (type == 'imageMessage') && mek.message.imageMessage.caption ? mek.message.imageMessage.caption : (type == 'videoMessage') && mek.message.videoMessage.caption ? mek.message.videoMessage.caption : (type == 'extendedTextMessage') && mek.message.extendedTextMessage.text ? mek.message.extendedTextMessage.text : ''.slice(1).trim().split(/ +/).shift().toLowerCase()
const prefix = /^[ø=|~!#$%^&.?/\\^z+*@,;]/.test(cmd) ? cmd.match(/^[ø=|~!#$%^&.?/\\^z+*,;]/gi) : '-'
body = (type === 'conversation' && mek.message.conversation.startsWith(prefix)) ? mek.message.conversation : (type == 'imageMessage') && mek.message.imageMessage.caption.startsWith(prefix) ? mek.message.imageMessage.caption : (type == 'videoMessage') && mek.message.videoMessage.caption.startsWith(prefix) ? mek.message.videoMessage.caption : (type == 'extendedTextMessage') && mek.message.extendedTextMessage.text.startsWith(prefix) ? mek.message.extendedTextMessage.text : (type == "buttonsResponseMessage") && mek.message[type].selectedButtonId ? mek.message[type].selectedButtonId : ''
budy = (type === 'conversation') ? mek.message.conversation : (type === 'extendedTextMessage') ? mek.message.extendedTextMessage.text : ''
var pes = (type === 'conversation' && mek.message.conversation) ? mek.message.conversation : (type == 'imageMessage') && mek.message.imageMessage.caption ? mek.message.imageMessage.caption : (type == 'videoMessage') && mek.message.videoMessage.caption ? mek.message.videoMessage.caption : (type == 'extendedTextMessage') && mek.message.extendedTextMessage.text ? mek.message.extendedTextMessage.text : ''
const manti = pes.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)
const q = args.join(' ')
const botNumber = elaina.user.jid
const botNumberss = elaina.user.jid + '@c.us'
const isGroup = from.endsWith('@g.us')
const sender = mek.key.fromMe ? elaina.user.jid : isGroup ? mek.participant : mek.key.remoteJid
const ownerNumber = [`${ownernumber}@s.whatsapp.net`]
const isOwner = mek.key.fromMe ? elaina.user.jid : ownerNumber.includes(sender)
const totalchat = await elaina.chats.all()
const groupMetadata = isGroup ? await elaina.groupMetadata(from) : ''
const groupName = isGroup ? groupMetadata.subject : ''
const groupId = isGroup ? groupMetadata.jid : ''
const groupMembers = isGroup ? groupMetadata.participants : ''
const groupDesc = isGroup ? groupMetadata.desc : ''
const groupOwner = isGroup ? groupMetadata.owner : ''
const groupAdmins = isGroup ? getGroupAdmins(groupMembers) : ''
const isBotGroupAdmins = groupAdmins.includes(botNumber) || false
const isGroupAdmins = groupAdmins.includes(sender) || false
const conts = mek.key.fromMe ? elaina.user.jid : elaina.contacts[sender] || { notify: jid.replace(/@.+/, '') }
const pushname = mek.key.fromMe ? elaina.user.name : conts.notify || conts.vname || conts.name || '-'
//apaya
const isAntiLink = isGroup ? antilink.includes(from) : false
//fake reply
let ftroli ={key: {fromMe: false,"participant":"[email protected]", "remoteJid": "[email protected]" }, "message": {orderMessage: {itemCount: 2021,status: 200, thumbnail: thumbnail, surface: 200, message: `${botname} \nBy ${ownername}`, orderTitle: 'zeeoneofc', sellerJid: '[email protected]'}},sendEphemeral: true}
let fdoc = {key : {participant : '[email protected]'},message: {documentMessage: {title: ` ${ownername}`,jpegThumbnail: thumbnail}}}
let fvn = {key: {participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {})},message: { "audioMessage": {"mimetype":"audio/ogg; codecs=opus","seconds":99999,"ptt": "true"}} }
let fgif = {key: {participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {})},message: {"videoMessage": { "title":` ${ownername}`, "h": `Hmm`,'seconds': '99999', 'gifPlayback': 'true', 'caption': `${botname} \nBy ${ownername}`, 'jpegThumbnail': thumbnail}}}
let fgclink = {key: {participant: "[email protected]","remoteJid": "[email protected]"},"message": {"groupInviteMessage": {"groupJid": "[email protected]","inviteCode": "m","groupName": "P", "caption": ` ${botname}`, 'jpegThumbnail': thumbnail}}}
let fgclink2 = {key: {participant: "[email protected]","remoteJid": "[email protected]"},"message": {"groupInviteMessage": {"groupJid": "[email protected]","inviteCode": "m","groupName": "P", "caption": ` ${botname}`, 'jpegThumbnail': thumbnail}}}
let fvideo = {key: { fromMe: false,participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {}) },message: { "videoMessage": { "title":` ${ownername}`, "h": `Hmm`,'seconds': '99999', 'caption': ` ${ownername}`, 'jpegThumbnail': thumbnail}}}
let floc = {contextInfo: {"forwardingScore":999,"isForwarded":true,'stanzaId': 'B826873620DD5947E683E3ABE663F263', 'participant':`[email protected]`, 'remoteJid': '[email protected]', 'quotedMessage': {"locationMessage": {"degreesLatitude": 41.893714904785156, "degreesLongitude": -87.63370513916016, "name": botname , 'jpegThumbnail':thumbnail}}}}
let fkontak = { key: {participant: `[email protected]`, ...(from ? { remoteJid: `[email protected]` } : {}) }, message: { 'contactMessage': { 'displayName': ` ${ownername}`, 'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:XL;${ownername},;;;\nFN:${ownername},\nitem1.TEL;waid=${sender.split('@')[0]}:${sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`, 'jpegThumbnail': thumbnail, thumbnail: thumbnail,sendEphemeral: true}}}
const isUrl = (url) => {
return 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) => {
elaina.sendMessage(from, teks, text, {quoted:mek})
}
const mentions = (teks, memberr, id) => {
(id == null || id == undefined || id == false) ? elaina.sendMessage(from, teks.trim(), extendedText, { contextInfo: { "mentionedJid": memberr } }) : elaina.sendMessage(from, teks.trim(), extendedText, { quoted: mek, contextInfo: { "mentionedJid": memberr } })
}
const sleep = async (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
function bytesToSize(bytes) {
return new Promise((resolve, reject) => {
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes === 0) return 'n/a';
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10);
if (i === 0) resolve(`${bytes} ${sizes[i]}`);
resolve(`${(bytes / (1024 ** i)).toFixed(1)} ${sizes[i]}`);
});
};
const checkLimit = (sender) => {
let found = false
for (let lmt of _limit) {
if (lmt.id === sender) {
let limitCounts = limitawal - lmt.limit
if (limitCounts <= 0) return elaina.sendMessage(from,`Limit kamu sudah habis`, text,{ quoted: mek})
elaina.sendMessage(from, lang.limitcount(isPremium, limitCounts), text, { quoted : mek})
found = true
}
}
if (found === false) {
let obj = { id: sender, limit: 1 }
_limit.push(obj)
fs.writeFileSync('./database/user/limit.json', JSON.stringify(_limit))
elaina.sendMessage(from, lang.limitcount(isPremium, limitCounts), text, { quoted : mek})
}
}
const isLimit = (sender) =>{
let position = false
for (let i of _limit) {
if (i.id === sender) {
let limits = i.limit
if (limits >= limitawal ) {
position = true
elaina.sendMessage(from, lang.limitend(pushname), text, {quoted: mek})
return true
} else {
_limit
position = true
return false
}
}
}
if (position === false) {
const obj = { id: sender, limit: 0 }
_limit.push(obj)
fs.writeFileSync('./database/user/limit.json',JSON.stringify(_limit))
return false
}
}
const limitAdd = (sender) => {
if (isOwner && isPremium) {return false;}
let position = false
Object.keys(_limit).forEach((i) => {
if (_limit[i].id == sender) {
position = i
}
})
if (position !== false) {
_limit[position].limit += 1
fs.writeFileSync('./database/user/limit.json', JSON.stringify(_limit))
}
}
const sendStickerFromUrl = async(to, url) => {
var names = Date.now() / 10000;
var download = function (uri, filename, callback) {
request.head(uri, function (err, res, body) {
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);
});
};
download(url, './stik' + names + '.png', async function () {
console.log('selesai');
let filess = './stik' + names + '.png'
let asw = './stik' + names + '.webp'
exec(`ffmpeg -i ${filess} -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${asw}`, (err) => {
let media = fs.readFileSync(asw)
elaina.sendMessage(to, media, MessageType.sticker,{quoted:mek})
fs.unlinkSync(filess)
fs.unlinkSync(asw)
});
});
}
const sendMediaURL = async(to, url, text="", mids=[]) =>{
if(mids.length > 0){
text = normalizeMention(to, text, mids)
}
const fn = Date.now() / 10000;
const filename = fn.toString()
let mime = ""
var download = function (uri, filename, callback) {
request.head(uri, function (err, res, body) {
mime = res.headers['content-type']
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);
});
};
download(url, filename, async function () {
console.log('done');
let media = fs.readFileSync(filename)
let type = mime.split("/")[0]+"Message"
if(mime === "image/gif"){
type = MessageType.video
mime = Mimetype.gif
}
if(mime.split("/")[0] === "audio"){
mime = Mimetype.mp4Audio
}
elaina.sendMessage(to, media, type, { quoted: mek, mimetype: mime, caption: text,contextInfo: {"mentionedJid": mids}})
fs.unlinkSync(filename)
});
}
const sendFileFromUrl = async (from, url, caption, mek, men) => {
let mime = '';
let res = await axios.head(url)
mime = res.headers['content-type']
if (mime.split("/")[1] === "gif") {
return elaina.sendMessage(from, await getBuffer(url), video ,{caption: caption, gifPlayback: true, mentions: men ? men : [], mimetype: 'video/mp4' ,quoted: mek})
}
let type = mime.split("/")[0]+"Message"
if(mime === "application/pdf"){
return elaina.sendMessage(from, await getBuffer(url), document, {mimetype: 'application/pdf', caption: caption, mentions: men ? men : [], quoted: mek })
}
if(mime.split("/")[0] === "image"){
return elaina.sendMessage(from, await getBuffer(url), image ,{ caption: caption, mentions: men ? men : [], quoted: mek})
}
if(mime.split("/")[0] === "video"){
return elaina.sendMessage(from, await getBuffer(url), video, {caption: caption, mentions: men ? men : [], mimetype: 'video/mp4', quoted: mek})
}
if(mime.split("/")[0] === "audio"){
return elaina.sendMessage(from, await getBuffer(url), audio, {caption: caption, mentions: men ? men : [], mimetype: 'audio/mpeg', quoted: mek })
}
}
// send message button
const sendButMessage = (id, text1, desc1, but = [], options = {}) => {
const buttonMessage = {
contentText: text1,
footerText: desc1,
buttons: but,
headerType: 1,
};
elaina.sendMessage(id, buttonMessage, MessageType.buttonsMessage, options);
};
const sendButLocation = async (id, text1, desc1, gam1, but = [], options = {}) => {
them = gam1
mediaxxaa = await elaina.prepareMessage(id, them, MessageType.location, {thumbnail: them})
locmhan = mediaxxaa.message["ephemeralMessage"] ? mediaxxaa.message.ephemeralMessage : mediaxxaa
const buttonMessages = {
locationMessage: locmhan.message.locationMessage,
contentText: text1,
footerText: desc1,
buttons: but,
headerType: 6
}
elaina.sendMessage(id, buttonMessages, MessageType.buttonsMessage, options)
}
const sendButVideo = async(id, text1, desc1, vid1, but = [], options = {}) => {
them = vid1
mediaxxaa = await elaina.prepareMessage(id, them, MessageType.video)
vimhan = mediaxxaa.message["ephemeralMessage"] ? mediaxxaa.message.ephemeralMessage : mediaxxaa
const buttonMessages = {
videoMessage: vimhan.message.videoMessage,
contentText: text1,
footerText: desc1,
buttons: but,
headerType: 5
}
elaina.sendMessage(id, buttonMessages, MessageType.buttonsMessage, options)
}
const sendButImage = async(id, text1, desc1, vid1, but = [], options = {}) => {
them = vid1
mediaxxaa = await elaina.prepareMessage(id, them, MessageType.image, {thumbnail: Buffer.alloc(0)})
imgmhan = mediaxxaa.message["ephemeralMessage"] ? mediaxxaa.message.ephemeralMessage : mediaxxaa
const buttonMessages = {
imageMessage: imgmhan.message.imageMessage,
contentText: text1,
footerText: desc1,
buttons: but,
headerType: 4
}
elaina.sendMessage(id, buttonMessages, MessageType.buttonsMessage, options)
}
// antilink
if (manti.includes("://chat.whatsapp.com/")){
if (!(isGroup || isAntiLink || isGroupAdmins)) return
var kic = `${sender.split("@")[0]}@s.whatsapp.net`
await elaina.sendMessage(from, `Hmm maap nih gua kick, dilarang share link di group ini`, text , {quoted: mek})
elaina.groupRemove(from, [kic]).catch((e)=>{reply(`Bot Harus Jadi Admin`)})
}
// SIAPA AKU
if (siapakahaku.hasOwnProperty(sender.split('@')[0]) && !isCmd && !mek.key.fromMe) {
jawaban = siapakahaku[sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
delete siapakahaku[sender.split('@')[0]]
sendButMessage(from, "Selamat Jawaban kamu benar!\n\n + Exp 500\n + Balance $10", ` ${botname} | ${ownername}`, [{"buttonId": `siapakahaku`,"buttonText": {"displayText": "Main Lagi"},"type": "RESPONSE"}], {quoted : mek})
addBalance(sender, 10, balance)
addLevelingXp(sender, 500)
fs.writeFileSync("./database/siapakahaku.json", JSON.stringify(siapakahaku))
} else {
reply2("Jawaban Salah!")
}
}
//game
if (tebakgambar.hasOwnProperty(sender.split('@')[0]) && !isCmd) {
jawaban = tebakgambar[sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
sendButMessage(from, "Selamat Jawaban kamu benar!", ` ${ownername}`, [{"buttonId": `.tebakgambar`,"buttonText": {"displayText": "Tebak Gambar"},"type": "RESPONSE"}], {quoted : mek})
delete tebakgambar[sender.split('@')[0]]
fs.writeFileSync("./database/game/tebakgambar.json", JSON.stringify(tebakgambar))
} else {
reply("Jawaban Salah!")
}
}
colors = ['red', 'pink', 'white', 'black', 'blue', 'yellow', 'green']
const iselaina = checkRegisteredUser(sender)
const isPremium = premium.includes(sender) || isOwner
const isMedia = (type === 'imageMessage' || type === 'videoMessage')
const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')
const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage')
const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')
const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')
const isQuotedText = type === 'extendedTextMessage' && content.includes('extendedTextMessage')
//console termux
if(!(isCmd)){
console.log(('|\x1b[1;33m MSG \x1b[1;33m|'), time, chalk.yellow(budy), 'from', chalk.green(pushname), 'args :', chalk.green(args.length), 'in', chalk.green(groupName? groupName : 'Private chat'))
}
if(!(isCmd || mek.key.fromMe)){
console.log(('|\x1b[1;32m CMD \x1b[1;37m|'), time, chalk.green(command), 'from', chalk.green(pushname), 'args :', chalk.green(args.length), 'in', chalk.green(groupName? groupName : 'Private chat'))
}
if (!mek.key.fromMe && global.self === true) return
//colong aja bang, ingat jgn asal colong ntr sc lu error
switch (command) {
case 'menu': case 'help': case 'elaina':
if (!iselaina) return sendButMessage(from, lang.noregis(pushname), `Klik Button Untuk Verify`, [{buttonId: '.daftar',buttonText: {displayText: `Daftar`,},type: 1,}], {quoted: fgif});
sendButLocation(from, lang.menu(prefix, salam, pushname), ' ' + ownername, thumbnail, [{buttonId: '.owner', buttonText: {displayText: 'Owner'}, type: 1},{buttonId: '.infobot', buttonText:{displayText: 'Infobot'}, type: 1}], {quoted: mek})
break
case 'infobot':
if (!iselaina) return sendButMessage(from, lang.noregis(pushname), `Klik Button Untuk Verify`, [{buttonId: '.daftar',buttonText: {displayText: `Daftar`,},type: 1,}], {quoted: fgif});
reply('Update bot selanjutnya silahkan cek YouTube RflBotz ofc')
break
case 'owner':{
if (!iselaina) return sendButMessage(from, lang.noregis(pushname), `Klik Button Untuk Verify`, [{buttonId: '.daftar',buttonText: {displayText: `Daftar`,},type: 1,}], {quoted: fgif});
const ownerContact = [ownernumber, "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]
let ini_list = []
for (let i of ownerContact.map(v => v + '@s.whatsapp.net')) {
const vname = elaina.contacts[i] != undefined ? elaina.contacts[i].vname || elaina.contacts[i].notify : undefined
ini_list.push({
"displayName": `${ownername}`,
"vcard": `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:${vname}\nitem1.TEL;waid=${i.split('@')[0]}:${i.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`
})
}
hehe = await elaina.sendMessage(from, {
"displayName": `${ini_list.length} kontak`,
"contacts": ini_list
}, 'contactsArrayMessage', { quoted: mek })
elaina.sendMessage(from, `Nih Kak Contact Owner Ku, Cuma Sv Nomor Cewe Ya `, text, {quoted: hehe})
}
break
case 'quotesimage':
get_result = await getBuffer(`https://api.lolhuman.xyz/api/random/quotesimage?apikey=${lolkey}`, {method: 'get'})
await elaina.sendMessage(from, get_result, image, { quoted: mek })
break
case 'sticker':case 'stiker':case 'stickergif':case 'stikergif':case 'sgif':case 's':
if ((isMedia && !mek.message.videoMessage || isQuotedImage) && args.length == 0) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek
const media = await elaina.downloadAndSaveMediaMessage(encmedia)
ran = getRandom('.webp')
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('Eror')
})
.on('end', function () {
console.log('Finish')
elaina.sendMessage(from, fs.readFileSync(ran), sticker, { quoted: mek })
fs.unlinkSync(media)
fs.unlinkSync(ran)
})
.addOutputOptions([`-vcodec`, `libwebp`, `-vf`, `scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:[email protected], split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(ran)
} else if ((isMedia && mek.message.videoMessage.seconds < 11 || isQuotedVideo && mek.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.seconds < 11) && args.length == 0) {
const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek
const media = await elaina.downloadAndSaveMediaMessage(encmedia)
ran = getRandom('.webp')
await ffmpeg(`./${media}`)
.inputFormat(media.split('.')[1])
.on('start', function (cmd) {
console.log(`Started : ${cmd}`)
})
.on('error', function (err) {
console.log(`Error : ${err}`)
fs.unlinkSync(media)
tipe = media.endsWith('.mp4') ? 'video' : 'gif'
reply(` Gagal, pada saat mengkonversi ${tipe} ke stiker`)
})
.on('end', function () {
console.log('Finish')
elaina.sendMessage(from, fs.readFileSync(ran), sticker, { quoted: mek })
fs.unlinkSync(media)
fs.unlinkSync(ran)
})
.addOutputOptions([`-vcodec`, `libwebp`, `-vf`, `scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:[email protected], split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(ran)
} else {
reply(`Kirim gambar dengan caption ${prefix}sticker atau tag gambar yang sudah dikirim\nDurasi sticker video 1-9 detik...`)
}
break
// download fix by zeeone
case 'ig': case 'igdl':
if (!q) return reply('Linknya?')
if (!isUrl(args[0]) && !args[0].includes('instagram.com')) return reply(mess.errorLink)
let urlnya = q
zee.Igdl(urlnya)
.then(async(result) => {
for(let i of result.medias){
if(i.url.includes('mp4')){
let link = await getBuffer(i.url)
elaina.sendMessage(from,link,video,{thumbnail: Buffer.alloc(0), quoted: mek,caption: `Instagram ${i.type}`})
} else {
let link = await getBuffer(i.url)
elaina.sendMessage(from,link,image,{thumbnail: Buffer.alloc(0), quoted: mek,caption: `Instagram ${i.type}`})
}
}
}).catch((err) => reply(` Server eror`))
break
case 'tiktok':
sendButLocation(from, 'Silahkan pilih media yang ingin kamu download', ' ' + ownername, thumbnail, [{buttonId: `.tiktokwm ${q}`, buttonText: {displayText: 'WM'}, type: 1},{buttonId: `.tiktoknowm ${q}`, buttonText:{displayText: 'NOWM'}, type: 1},{buttonId: `.tiktokmusic ${q}`, buttonText:{displayText: 'AUDIO'}, type: 1}], {quoted: mek})
break
case 'randommeme':
get_result = await getBuffer(`https://api.lolhuman.xyz/api/random/meme?apikey=${lolkey}`, {method: 'get'})
await elaina.sendMessage(from, get_result, image, { quoted: mek })
break
case 'memeindo':
get_result = await getBuffer(`https://api.lolhuman.xyz/api/meme/memeindo?apikey=${lolkey}`, {method: 'get'})
await elaina.sendMessage(from, get_result, image, { quoted: mek })
break
case 'darkjoke':
get_result = await getBuffer(`https://api.lolhuman.xyz/api/meme/darkjoke?apikey=${lolkey}`, {method: 'get'})
await elaina.sendMessage(from, get_result, image, {quoted: mek, caption: 'Random Meme, Jangan Baper!!'})
break
case 'siapakahaku': case 'siapaaku':{
if (isGame(sender, isPremium, isCreator, isOwner, gcounttuser, glimit)) return sendButMessage(from, lang.limitg(prefix), ` ${ownername}`, [{buttonId: 'limit', buttonText: {displayText: `Check Limit`, },type: 1,}]);
if (siapakahaku.hasOwnProperty(sender.split('@')[0])) return reply("Masih ada permainan yang sedang berlangsung")
let anu = await fetchJson(`https://api.lolhuman.xyz/api/tebak/siapaaku?apikey=${lolkey}`)
let result = anu[Math.floor(Math.random() * anu.length)]
let jawaban = `${result.jawaban}`
siapakahaku[sender.split('@')[0]] = jawaban.toLowerCase()
fs.writeFileSync("./src/siapakahaku.json", JSON.stringify(siapakahaku))
console.log(jawaban)
let tebakya = result.soal
elaina.sendMessage(from, tebakya + '\n\n Timeout : 120.00 seconds\n + Exp 500\n + Balance $10' , text, {quoted: mek})
await sleep(120000)
if (siapakahaku.hasOwnProperty(sender.split('@')[0])) {
elaina.sendMessage(from, " Waktu permainan habis " + '\n\n' +"* Jawaban :*" + '' + '_'+ jawaban +'_', text, {quoted: mek}) // ur cods
delete siapakahaku[sender.split('@')[0]]
fs.writeFileSync("./src/siapakahaku.json", JSON.stringify(siapakahaku))
}
await gameAdd(sender, glimit)}
break
case 'tiktoknowm':
if (!q) return reply('Linknya?')
if (!isUrl(args[0]) && !args[0].includes('tiktok.com')) return reply('Invalid link')
reply(lang.wait())
let nowem = q
zee.Ttdownloader(nowem)
.then(result => {
const { wm, nowm, audio } = result
axios.get(`https://tinyurl.com/api-create.php?url=${nowm}`)
.then(async (a) => {
me = `*Link* : ${a.data}`
noweem = await getBuffer(nowm)
elaina.sendMessage(from,noweem , MessageType.video, {mimetype: 'video/mp4',quoted: mek})
})
}).catch((err) => reply(`teLink tidak valid`))
break
case 'quotesanime':
quotes = await fetchJson(`https://api.lolhuman.xyz/api/random/quotesnime?apikey=${lolkey}`)
quotes = quotes.result
quote = quotes.quote
char = quotes.character
anime = quotes.anime
episode = quotes.episode
reply(`_${quote}_\n\n*char: ${char}*\n*anime: ${anime} ${episode}*`)
break
case 'wallpaperanime':
buffer = await getBuffer(`http://api.lolhuman.xyz/api/random2/wallpaper?apikey=${lolkey}`)
elaina.sendMessage(from, buffer, image, { quoted: mek })
break
case 'tiktokwm':
if (!q) return reply('Linknya?')
if (!isUrl(args[0]) && !args[0].includes('tiktok.com')) return reply('Invalid link')
reply(lang.wait())
let wem = args.join(' ')
zee.Ttdownloader(wem)
.then(result => {
const { wm, nowm, audio } = result
axios.get(`https://tinyurl.com/api-create.php?url=${nowm}`)
.then(async (a) => {
me = `*Link* : ${a.data}`
weem = await getBuffer(wm)
elaina.sendMessage(from,weem , MessageType.video, {mimetype: 'video/mp4',quoted: mek})
})
}).catch((err) => reply(`Link tidak valid`))
break
case 'quotesislami':
anu = await fetchJson(`https://api.lolhuman.xyz/api/quotes/islami?apikey=${lolkey}`, {method: 'get'})
reply(`*Random Quotes Islami*\n${anu.result}`)
break
case 'tiktokmusic': case 'tiktokaudio':
if (!q) return reply('Linknya?')
if (!isUrl(args[0]) && !args[0].includes('tiktok.com')) return reply('Invalid Link')
reply(lang.wait())
let audi = q
zee.Ttdownloader(audi)
.then(result => {
const { wm, nowm, audio } = result
axios.get(`https://tinyurl.com/api-create.php?url=${audio}`)
.then(async (a) => {
audnha = await getBuffer(audio)
elaina.sendMessage(from,audnha , MessageType.document, {mimetype: 'audio/mp4',filename: `Tiktok Music.mp3`,quoted: mek})
})
}).catch((err) => reply(`Link tidak valid`))
break
case 'jadwaltv':
if (args.length == 0) return reply(`Nama Channel Nya Mana Tod\nContoh: ${prefix + command} SCTV`)
channel = args[0]
get_result = await fetchJson(`https://api.lolhuman.xyz/api/jadwaltv/${channel}?apikey=${lolkey}`)
get_result = get_result.result
ini_txt = `Jadwal TV ${channel.toUpperCase()}\n`
for (var x in get_result) {
ini_txt += `${x} - ${get_result[x]}\n`
}
reply(ini_txt)
break
case 'quotesdilan':
quotedilan = await fetchJson(`https://api.lolhuman.xyz/api/quotes/dilan?apikey=${lolkey}`)
reply(quotedilan.result)
break
case 'faktaunik':
faktaunik = await fetchJson(`https://api.lolhuman.xyz/api/random/faktaunik?apikey=${lolkey}`)
reply(`*Taukah kamu ternyata*\n${faktaunik.result}`)
break
case 'wikipedia':
if (args.length == 0) return reply(`Nama Yg Mau Di Cari Mana Kak\nContoh: ${prefix + command} Tahu`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/wiki?apikey=${lolkey}`)
get_result = get_result.result
reply(get_result)
break
case 'translate':
if (args.length == 0) return reply(`Teks Yg Mau Di Translate Mana Kak\nContoh: ${prefix + command} en Good Morning`)
kode_negara = args[0]
args.shift()
ini_txt = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/translate/auto/id?apikey=${lolkey}`)
get_result = get_result.result
init_txt = `From : ${get_result.from}\n`
init_txt += `To : ${get_result.to}\n`
init_txt += `Original : ${get_result.original}\n`
init_txt += `Translated : ${get_result.translated}\n`
init_txt += `Pronunciation : ${get_result.pronunciation}\n`
reply(init_txt)
break
case 'katabijak':
anu = await fetchJson(`https://api.lolhuman.xyz/api/random/katabijak?apikey=${lolkey}`)
reply(anu.result)
break
case 'pinterest':
if(!q) return reply('Masukkan query')
async function pinterestSearch(query) {
return new Promise((resolve, reject) => {
fetch(`https://www.pinterest.com/resource/BaseSearchResource/get/?source_url=%2Fsearch%2Fpins%2F%3Fq%3D${query}&data=%7B%22options%22%3A%7B%22isPrefetch%22%3Afalse%2C%22query%22%3A%22${query}%22%2C%22scope%22%3A%22pins%22%2C%22no_fetch_context_on_resource%22%3Afalse%7D%2C%22context%22%3A%7B%7D%7D&_=1619980301559`, {
"headers": {
"accept": "application/json, text/javascript, */*, q=0.01",
"accept-language": "en-US,en;q=0.9",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"sec-gpc": "1",
"x-app-version": "9a236a4",
"x-pinterest-appstate": "active",
"x-requested-with": "XMLHttpRequest"
},
"referrer": "https://www.pinterest.com/",
"referrerPolicy": "origin",
"body": null,
"method": "GET",
"mode": "cors"
}).then((res) => res.json())
.then((json) => {
const generatepin = json.resource_response.data.results[Math.floor(Math.random() * (json.resource_response.data.results.length))]
var result = [];
result.push({
link: generatepin.images.orig.url
})
resolve(result)
}).catch(reject)
})
}
const pinterest = (query) => new Promise((resolve, reject) => {
pinterestSearch(query).then((data) => {
resolve({
status: 200,
image: data[0].link
})
}).catch(reject)
})
pinterest(q).then(async(res) => {
let we = await getBuffer(res.image)
sendButImage(from, lang.ok() , ` ${ownername}`,we, [{"buttonId": `.pinterest ${q}`,"buttonText": {"displayText": "Next"},"type": "RESPONSE"}], {thumbnail: Buffer.alloc(0), quoted: mek})
}).catch(async(err) => {
reply('Terjadi kesalahan')
})
break
case 'alquranaudio':
if (args.length == 0) return reply(`Nomor Surah Yg Mau Dicari Mana\nContoh : ${prefix + command} 18 or ${prefix + command} 18/10`)
reply('Sabar Sedang Proses...')
surah = args[0]
ini_buffer = await getBuffer(`https://api.lolhuman.xyz/api/quran/audio/${surah}?apikey=${lolkey}`)
await elaina.sendMessage(from, ini_buffer, audio, { quoted: mek, mimetype: Mimetype.mp4Audio })
break
case 'kisahnabi':
if (args.length == 0) return reply(`Nama Nabi Yg Mau Dicari Mana\nContoh : ${prefix + command} Muhammad`)
query = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/kisahnabi/muhammad?apikey=${lolkey}`)
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(`Nama Kotanya Mana\nContoh : ${prefix + command} Yogyakarta`)
daerah = args.join(" ")
get_result = await fetchJson(`https://api.lolhuman.xyz/api/sholat/yogyakarta?apikey=${lolkey}`)
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
case 'asmaulhusna':
get_result = await fetchJson(`https://api.lolhuman.xyz/api/asmaulhusna?apikey=${lolkey}`)
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 'listsurah':
get_result = await fetchJson(`https://api.lolhuman.xyz/api/quran?apikey=${lolkey}`)
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 'play': case 'song':
if (args.length === 0) return reply(`Kirim perintah *${prefix}play* _Judul lagu_`)
var srch = args.join(' ')
aramas = await yts(srch);
aramat = aramas.all
var mulaikah = aramat[0].url
try {
zee.Youtube(mulaikah).then(async (data) => {
if (Number(data.medias[7].formattedSize) >= 100000) return sendMediaURL(from, thumb, `*PLAY MUSIC*\n\n*Title* : ${title}\n*Ext* : MP3\n*Filesize* : ${filesizeF}\n*Link* : ${a.data}\n\n_Untuk durasi lebih dari batas disajikan dalam bentuk link_`)
const captions = `*---- PLAY MUSIC ----*
Title : ${aramas.videos[0].title}
ID : ${aramas.videos[0].videoId}
Upload : ${aramas.videos[0].ago}
Size : ${data.medias[7].formattedSize}
Views: ${aramas.videos[0].views}
Duration : ${aramas.videos[0].timestamp}
Url : ${aramas.videos[0].url}`
var thumbyt = await getBuffer(aramas.videos[0].thumbnail)
sendButLocation(from, captions, ' ' + ownername, thumbyt, [{buttonId: `.ytmp4 ${mulaikah}`, buttonText: {displayText: 'Video'}, type: 1},{buttonId: `.ytmp3 ${mulaikah}`, buttonText:{displayText: 'Audio'}, type: 1}], {quoted: mek})
})
} catch (err) {
reply('Terjadi kesalahan')
}
break
//group
case 'daftar': case 'verify': case 'verif':
if (iselaina) return reply(lang.regis())
try {
ppregis = await elaina.getProfilePicture(sender)
} catch {
ppregis = 'https://i.ibb.co/rvsVF3r/5012fbb87660.png'
}
const serialUser = createSerial(20)
await addRegisteredUser(sender.split('@')[0] + '@s.whatsapp.net', pushname, time, serialUser)
await sendButImage(from, lang.daftar(sender, pushname, time, serialUser, _registered), ` ${botname}`,await getBuffer(ppregis), [{buttonId: '.menu',buttonText: {displayText: `MENU`,},type: 1,}], {thumbnail: Buffer.alloc(0), quoted : mek})
break
case 'antilink':
if (!isGroup) return reply(lang.group())
if (!isGroupAdmins) return reply(lang.admin(groupName))
if (!isBotGroupAdmins) return reply(lang.adminB())
if (Number(args[0]) === 1) {
if (isAntiLink) return reply('Telah di aktifkan sebelumnya')
antilink.push(from)
fs.writeFileSync('./database/group/antilink.json', JSON.stringify(antilink))
reply(` Berhasil mengaktifkan ${command}`)
} else if (Number(args[0]) === 0) {
if (!isAntiLink) return reply('Udh mati')
var ini = anti.botLangsexOf(from)
antilink.splice(ini, 1)
fs.writeFileSync('./database/group/antilink.json', JSON.stringify(antilink))
reply(` Berhasil mematikan ${command}`)
} else {
reply('1 untuk mengaktifkan, 0 untuk menonaktifkan')
}
break
case 'memegenerator': case 'memegen':{
if (args.length < 1) return reply(`Kirim perintah *${prefix + command}* teks atas|teks bawah`)
if (!q.includes('|')) return reply(`Kirim perintah *${prefix + command}* teks atas|teks bawah`)
try {
if (!isQuotedImage) return reply(`Reply Gambar!`)
reply(lang.wait())
var teks1 = q.split('|')[0] ? q.split('|')[0] : ''
var teks2 = q.split('|')[1] ? q.split('|')[1] : ''
var enmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek
var mediiia = await elaina.downloadMediaMessage(enmedia)
var njay = await uploadImages(mediiia)
var resu = await getBuffer(`https://api.memegen.link/images/custom/${teks1}/${teks2}.png?background=${njay}`)
elaina.sendMessage(from, resu, image, {caption:'.stikerin bang', thumbnail: Buffer.alloc(0), quoted: mek})
fs.unlinkSync(mediiia)
} catch (e) {
reply(lang.err())
console.log(e)
}
}
break
case 'stickermeme': case 'memesticker': case 'memestick': case 'stickmeme': case 'stcmeme': case 'smeme':{
if (args.length < 1) return reply(`Kirim perintah *${prefix + command}* Alphabot`)
if (q.includes('|')) return reply(`Kirim perintah *${prefix + command}* Alphabot`)
try {
if (!isQuotedImage) return reply(`Reply Gambar!`)
reply(lang.wait())
var teks2 = args.join(' ')
var enmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek
var mediia = await elaina.downloadMediaMessage(enmedia)
var njay = await uploadImages(mediia)
var resu = `https://api.memegen.link/images/custom/-/${teks2}.png?background=${njay}`
sendStickerFromUrl(from,`${resu}`)
} catch (e) {
reply(lang.err())
console.log(e)
}
}
break
case 'leave':
if (!isGroup) return reply(lang.group())
if (!isOwner) return reply(lang.owner(botname))
setTimeout( () => {
elaina.groupLeave(from)
}, 2000)
setTimeout( () => {
elaina.sendMessage(from, 'Sayonara', text)
}, 0)
break
case 'bot':
if (!iselaina) return sendButMessage(from, lang.noregis(pushname), `Klik Button Untuk Verify`, [{buttonId: '.daftar',buttonText: {displayText: `Daftar`,},type: 1,}], {quoted: fgif});
sound = fs.readFileSync('Sound/bott.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt:true})
break
sound = fs.readFileSync('Sound/soundultah.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound1':
sound = fs.readFileSync('Sound/sound1.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound2':
sound = fs.readFileSync('Sound/sound2.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound3':
sound = fs.readFileSync('Sound/sound3.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound4':
sound = fs.readFileSync('Sound/sound4.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound5':
sound = fs.readFileSync('Sound/sound5.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound6':
sound = fs.readFileSync('Sound/sound6.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound7(':
sound = fs.readFileSync('Sound/sound7.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound8':
sound = fs.readFileSync('Sound/sound8.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound9':
sound = fs.readFileSync('Sound/sound9.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound10':
sound = fs.readFileSync('Sound/sound10.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound11':
sound = fs.readFileSync('Sound/sound11.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound12':
sound = fs.readFileSync('Sound/sound12.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound13':
sound = fs.readFileSync('Sound/sound13.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound14':
sound = fs.readFileSync('Sound/sound14.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound15':
sound = fs.readFileSync('Sound/sound15.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound16':
sound = fs.readFileSync('Sound/sound16.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound17':
sound = fs.readFileSync('Sound/sound17.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound18':
sound = fs.readFileSync('Sound/sound18.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound19':
sound = fs.readFileSync('Sound/sound19.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound20':
sound = fs.readFileSync('Sound/sound20.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound21':
sound = fs.readFileSync('Sound/sound21.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound22':
sound = fs.readFileSync('Sound/sound22.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound23':
sound = fs.readFileSync('Sound/sound23.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break
case 'sound24':
sound = fs.readFileSync('Sound/sound24.mp3')
elaina.sendMessage(from, sound, MessageType.audio, {quoted: mek, mimetype: 'audio/mp4', ptt: false})
break