-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathfdciabdul.js
628 lines (616 loc) · 29.2 KB
/
fdciabdul.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
/*
BY fdciabdulZZ
*/
const
{
WAConnection,
MessageType,
Presence,
MessageOptions,
Mimetype,
WALocationMessage,
WA_MESSAGE_STUB_TYPES,
ReconnectMode,
ProxyAgent,
GroupSettingChange,
waChatKey,
mentionedJid,
processTime,
} = require("@adiwajshing/baileys");
const moment = require("moment-timezone");
const fs = require("fs");
const { exec } = require('child_process');
const fdciabdul = require('./whatsapp/message.js');
const speed = require('performance-now');
const ffmpeg = require('fluent-ffmpeg');
const conn = require('./whatsapp/connect');
const { color } = require('./lib/color');
const mess = JSON.parse(fs.readFileSync('./whatsapp/mess.json'));
const axios = require('axios');
const Exif = require('./lib/exif');
const { uptotele, uptonaufal } = require('./lib/uploadimage')
const exif = new Exif();
conn.connect()
const fdciabdul = conn.fdciabdul
fake = 'fdciabdul'
fakeimage = fs.readFileSync(`./media/fdciabdul.jpeg`)
prefix = '!'
public = true
fdciabdul.on('chat-update', async(msg) => {
console.log(msg);
console.log(msg.messages.array[0].message.conversation);
const nomor = msg.jid;
const pesan = msg.messages.array[0].message.conversation;
const simi = await axios.get("https://fdciabdul.tech/api/ayla/?pesan=" + pesan);
fdciabdul.sendText(nomor, simi.data.jawab)
})
fdciabdul.on('message-new', async(qul) => {
try {
if (!qul.message) return
if (qul.key && qul.key.remoteJid == 'status@broadcast') return
global.prefix
const content = JSON.stringify(qul.message)
const from = qul.key.remoteJid
const type = Object.keys(qul.message)[0]
const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType
const time = moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss')
body = (type === 'conversation' && qul.message.conversation.startsWith(prefix)) ? qul.message.conversation : (type == 'imageMessage') && qul.message.imageMessage.caption.startsWith(prefix) ? qul.message.imageMessage.caption : (type == 'videoMessage') && qul.message.videoMessage.caption.startsWith(prefix) ? qul.message.videoMessage.caption : (type == 'extendedTextMessage') && qul.message.extendedTextMessage.text.startsWith(prefix) ? qul.message.extendedTextMessage.text : ''
chats = (type === 'conversation') ? qul.message.conversation : (type === 'extendedTextMessage') ? qul.message.extendedTextMessage.text : ''
const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()
const args = body.trim().split(/ +/).slice(1)
const isCmd = body.startsWith(prefix)
const arg = chats.slice(command.length + 2, chats.length)
const ramadhan = await axios.get('https://fdciabdulbot-api.herokuapp.com/api/hitungmundur?apikey=fdciabdulBot&tanggal=12&bulan=4')
const ucapan = await axios.get('https://fdciabdulbot-api.herokuapp.com/api/ucapan?apikey=fdciabdulBot&timeZone=Asia/Jakarta')
const botNumber = fdciabdul.user.jid
const isGroup = from.endsWith('@g.us')
const sender = qul.key.fromMe ? fdciabdul.user.jid : isGroup ? qul.participant : qul.key.remoteJid
const totalchat = await fdciabdul.chats.all()
const groupMetadata = isGroup ? await fdciabdul.groupMetadata(from) : ''
const groupName = isGroup ? groupMetadata.subject : ''
const groupId = isGroup ? groupMetadata.jid : ''
const groupMembers = isGroup ? groupMetadata.participants : ''
const groupDesc = isGroup ? groupMetadata.desc : ''
const groupAdmins = isGroup ? fdciabdul.getGroupAdmins(groupMembers) : ''
const groupOwner = isGroup ? groupMetadata.owner : ''
const itsMe = sender === botNumber ? true : false
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 isMedia = (type === 'imageMessage' || type === 'videoMessage')
const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')
const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')
const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage')
const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')
if (itsMe){
if (chats.toLowerCase() === `${prefix}self`){
public = false
fdciabdul.sendFakeStatus(from, `Sukses`, `Status: SELF`)
}
if (chats.toLowerCase() === 'status'){
fdciabdul.sendFakeStatus(from, `STATUS: ${public ? 'PUBLIC' : 'SELF'}`)
}
}
if (!public){
if (!qul.key.fromMe) return
}
if (isCmd && !isGroup) {console.log(color('[CMD]'), color(moment(qul.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`))}
if (isCmd && isGroup) {console.log(color('[CMD]'), color(moment(qul.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`), 'from', color(fdciabdul.user.name), 'in', color(groupName))}
switch (command) {
case 'menu': case 'help':
textnya = `*${ucapan.data.result}*
Hitung mundur ramdhan
=> ${ramadhan.data.result}
No prefix
=> status
=> > <eval>
=> ${prefix}sticker
=> ${prefix}swm nama | author
=> ${prefix}takestick namma | author
=> ${prefix}colong <reply stiker>
=> ${prefix}self
=> ${prefix}public
=> ${prefix}hidetag
=> ${prefix}runtime
=> ${prefix}speed
=> ${prefix}mystat
=> ${prefix}kontak
=> ${prefix}hidetag
=> ${prefix}term
=> ${prefix}setreply
=> ${prefix}setprefix
=> ${prefix}setname
=> ${prefix}setbio
=> ${prefix}fdeface
=> ${prefix}fakethumbnail
=> ${prefix}setthumb
=> ${prefix}getpic
=> ${prefix}stickertag
=> ${prefix}imgtag
=> ${prefix}kontaktag
=> ${prefix}tahta teks
=> ${prefix}pubg teks1|teks2
=> ${prefix}promote
=> ${prefix}demote
=> ${prefix}kick
=> ${prefix}add
=> ${prefix}creategrup nama|tag
=> ${prefix}getgrup
=> ${prefix}upstatus text
=> ${prefix}tovideo
=> ${prefix}togif
=> ${prefix}spam teks|jumlah spam
=> ${prefix}imgtourl
More? rakit sendirilah`
fdciabdul.sendFakeStatusWithImg(from, fakeimage, textnya, fake)
break
case 'test':
fdciabdul.sendText(from, 'oke')
break
case 'public':
public = true
fdciabdul.sendFakeStatus(from, `Status: PUBLIC`, fake)
break
case 'exif':
if (args.length < 1) return fdciabdul.reply(from, `Penggunaan ${prefix}exif nama|author`, qul)
if (!arg.split('|')) return fdciabdul.reply(from, `Penggunaan ${prefix}exif nama|author`, qul)
exif.create(arg.split('|')[0], arg.split('|')[1])
fdciabdul.reply(from, 'sukses', qul)
break
case 'sticker':
case 'stiker':
case 's':
if (isMedia && !qul.message.videoMessage || isQuotedImage) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
await ffmpeg(`${media}`)
.input(media)
.on('start', function (cmd) {
console.log(`Started : ${cmd}`)
})
.on('error', function (err) {
console.log(`Error : ${err}`)
fs.unlinkSync(media)
fdciabdul.reply(from, mess.error.api, qul)
})
.on('end', function () {
console.log('Finish')
exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return fdciabdul.reply(from, mess.error.api, qul)
fdciabdul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/${sender}.webp`)
})
})
.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(`./sticker/${sender}.webp`)
} else if ((isMedia && qul.message.videoMessage.fileLength < 10000000 || isQuotedVideo && qul.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.fileLength < 10000000)) {
const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
fdciabdul.reply(from, mess.wait, qul)
await ffmpeg(`${media}`)
.inputFormat(media.split('.')[4])
.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'
fdciabdul.reply(from, mess.error.api, qul)
})
.on('end', function () {
console.log('Finish')
exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return fdciabdul.reply(from, mess.error.api, qul)
fdciabdul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/${sender}.webp`)
})
})
.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(`./sticker/${sender}.webp`)
} else {
fdciabdul.reply(from, `Kirim gambar/video dengan caption ${prefix}sticker atau tag gambar/video yang sudah dikirim\nNote : Durasi video maximal 10 detik`, qul)
}
break
case 'swm':
case 'stickerwm':
if (isMedia && !qul.message.videoMessage || isQuotedImage) {
if (!arg.includes('|')) return fdciabdul.reply(from, `Kirim gambar atau reply gambar dengan caption *${prefix}stickerwm nama|author*`, qul)
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
const packname1 = arg.split('|')[0]
const author1 = arg.split('|')[1]
exif.create(packname1, author1, `stickwm_${sender}`)
await ffmpeg(`${media}`)
.input(media)
.on('start', function (cmd) {
console.log(`Started : ${cmd}`)
})
.on('error', function (err) {
console.log(`Error : ${err}`)
fs.unlinkSync(media)
fdciabdul.reply(from, mess.error.api, qul)
})
.on('end', function () {
console.log('Finish')
exec(`webpmux -set exif ./sticker/stickwm_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return fdciabdul.reply(from, mess.error.api, qul)
fdciabdul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/${sender}.webp`)
fs.unlinkSync(`./sticker/stickwm_${sender}.exif`)
})
})
.addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:[email protected], split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(`./sticker/${sender}.webp`)
} else if ((isMedia && qul.message.videoMessage.fileLength < 10000000 || isQuotedVideo && qul.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.fileLength < 10000000)) {
if (!arg.includes('|')) return fdciabdul.reply(from, `Kirim gambar atau reply gambar dengan caption *${prefix}stickerwm nama|author*`, qul)
const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
const packname1 = arg.split('|')[0]
const author1 = arg.split('|')[1]
exif.create(packname1, author1, `stickwm_${sender}`)
fdciabdul.reply(from, mess.wait, qul)
await ffmpeg(`${media}`)
.inputFormat(media.split('.')[4])
.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'
fdciabdul.reply(from, mess.error.api, qul)
})
.on('end', function () {
console.log('Finish')
exec(`webpmux -set exif ./sticker/stickwm_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return fdciabdul.reply(from, mess.error.api, qul)
fdciabdul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/${sender}.webp`)
fs.unlinkSync(`./sticker/stickwm_${sender}.exif`)
})
})
.addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:[email protected], split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(`./sticker/${sender}.webp`)
} else {
fdciabdul.reply(from, `Kirim gambar/video dengan caption ${prefix}stickerwm nama|author atau tag gambar/video yang sudah dikirim\nNote : Durasi video maximal 10 detik`, id)
}
break
case 'takestick':
if (!isQuotedSticker) return fdciabdul.reply(from, `Reply sticker dengan caption *${prefix}takestick nama|author*`, qul)
const pembawm = body.slice(11)
if (!pembawm.includes('|')) return fdciabdul.reply(from, `Reply sticker dengan caption *${prefix}takestick nama|author*`, qul)
const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
const packname = pembawm.split('|')[0]
const author = pembawm.split('|')[1]
exif.create(packname, author, `takestick_${sender}`)
exec(`webpmux -set exif ./sticker/takestick_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return fdciabdul.reply(from, mess.error.api, qul)
fdciabdul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/takestick_${sender}.exif`)
})
break
case 'colong':
if (!isQuotedSticker) return fdciabdul.reply(from, `Reply sticker dengan caption *${prefix}colong*`, qul)
const encmediia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const meidia = await fdciabdul.downloadAndSaveMediaMessage(encmediia, `./sticker/${sender}`)
exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return fdciabdul.reply(from, mess.error.api, qul)
fdciabdul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(meidia)
})
break
case 'hidetag':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}hidetag teks`, qul)
fdciabdul.hideTag(from, arg)
break
case 'runtime':
run = process.uptime()
let text = fdciabdul.runtime(run)
fdciabdul.sendFakeStatus(from, text, `Runtime bro`)
break
case 'speed': case 'ping':
let timestamp = speed();
let latensi = speed() - timestamp
fdciabdul.sendFakeStatus(from, `Speed: ${latensi.toFixed(4)}second`, fake)
break
case 'mystat': case 'mystatus':
let i = []
let giid = []
for (mem of totalchat){
i.push(mem.jid)
}
for (id of i){
if (id && id.includes('g.us')){
giid.push(id)
}
}
let timestampi = speed();
let latensii = speed() - timestampi
const { wa_version, mcc, mnc, os_version, device_manufacturer, device_model } = fdciabdul.user.phone
anu = process.uptime()
teskny = `*V. Whatsapp :* ${wa_version}
*RAM :* ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB / ${Math.round(require('os').totalmem / 1024 / 1024)}MB
*MCC :* ${mcc}
*MNC :* ${mnc}
*Versi OS :* ${os_version}
*Merk HP :* ${device_manufacturer}
*Versi HP :* ${device_model}
*Group Chat :* ${giid.length}
*Personal Chat :* ${totalchat.length - giid.length}
*Total Chat :* ${totalchat.length}
*Speed :* ${latensii.toFixed(4)} Second
*Runtime :* ${fdciabdul.runtime(anu)}`
fdciabdul.sendFakeStatus(from, teskny, fake)
break
case 'kontak':
argz = arg.split('|')
if (!argz) return fdciabdul.reply(from, `Penggunaan ${prefix}kontak @tag atau nomor|nama`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
fdciabdul.sendKontak(from, mentioned[0].split('@')[0], argz[1])
} else {
fdciabdul.sendKontak(from, argz[0], argz[1])
}
break
case 'term':
if (!arg) return
exec(arg, (err, stdout) => {
if (err) return fdciabdul.sendFakeStatus(from, err, fake)
if (stdout) fdciabdul.sendFakeStatus(from, stdout, fake)
})
break
case 'setreply':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}setreply teks`, qul)
fake = arg
fdciabdul.sendFakeStatus(from, `Sukses`, fake)
break
case 'setprefix':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}setprefix prefix`, qul)
prefix = arg
fdciabdul.sendFakeStatus(from, `Prefix berhasil diubah menjadi ${prefix}`, fake)
break
case 'setname':
if (!arg) return fdciabdul.reply(from, 'masukkan nama', qul)
fdciabdul.setName(arg)
.then((res) => fdciabdul.sendFakeStatus(from, JSON.stringify(res), fake))
.catch((err) => fdciabdul.sendFakeStatus(from, JSON.stringify(err), fake))
break
case 'setbio':
if (!arg) return fdciabdul.reply(from, 'masukkan bio', qul)
fdciabdul.setBio(arg)
.then((res) => fdciabdul.sendFakeStatus(from, JSON.stringify(res), fake))
.catch((err) => fdciabdul.sendFakeStatus(from, JSON.stringify(err), fake))
break
case 'fdeface': case 'hack':
if (!arg) return fdciabdul.reply(from, `Penggunaaan ${prefix}fdeface url|title|desc|url\n\nContoh : ${prefix}fdeface https://google.com|Self Bot|By fdciabdulzz|https://fdciabdul.com`, qul)
argz = arg.split("|")
if (!argz) return fdciabdul.reply(from, `Penggunaaan ${prefix}fdeface url|title|desc|url\n\nContoh : ${prefix}fdeface https://google.com|Self Bot|By fdciabdulzz|https://fdciabdul.com`, qul)
if ((isMedia && !qul.message.videoMessage || isQuotedImage)) {
let encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo : qul
let media = await fdciabdul.downloadMediaMessage(encmedia)
fdciabdul.sendFakeThumb(from, argz[0], argz[1], argz[2], argz[3], media)
} else {
fdciabdul.sendFakeThumb(from, argz[0], argz[1], argz[2], argz[3])
}
break
case 'fakethumbnail': case 'fthumbnail': case 'fakethumb':
if ((isMedia && !qul.message.videoMessage || isQuotedImage)) {
let encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo : qul
let media = await fdciabdul.downloadMediaMessage(encmedia)
fdciabdul.sendFakeImg(from, media, arg, fakeimage, qul)
} else {
fdciabdul.reply(from, `Kirim gambar atau reply dengan caption ${prefix}fakethumb caption`, qul)
}
break
case 'setthumb':
boij = JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
delb = await fdciabdul.downloadMediaMessage(boij)
fs.writeFileSync(`./media/fdciabdul.jpeg`, delb)
fakeimage = fs.readFileSync(`./media/fdciabdul.jpeg`)
fdciabdul.sendFakeStatus(from, `Sukses`, fake)
break
case 'getpic':
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
try {
pic = await fdciabdul.getProfilePicture(mentioned[0])
} catch {
pic = 'https://i.ibb.co/Tq7d7TZ/age-hananta-495-photo.png'
}
thumb = await fdciabdul.getBuffer(pic)
fdciabdul.sendImage(from, thumb)
}
break
case 'imgtag':
if ((isMedia && !qul.message.videoMessage || isQuotedImage)) {
let encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo : qul
let media = await fdciabdul.downloadMediaMessage(encmedia)
fdciabdul.hideTagImg(from, media)
} else {
fdciabdul.reply(from, `Kirim gambar atau reply dengan caption ${prefix}imgtag caption`, qul)
}
break
case 'sticktag': case 'stickertag':
if (!isQuotedSticker) return fdciabdul.reply(from, `Reply sticker dengan caption *${prefix}stickertag*`, qul)
let encmediai = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
let mediai = await fdciabdul.downloadMediaMessage(encmediai)
fdciabdul.hideTagSticker(from, mediai)
break
case 'kontaktag':
argz = arg.split('|')
if (!argz) return fdciabdul.reply(from, `Penggunaan ${prefix}kontak @tag atau nomor|nama`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
fdciabdul.hideTagKontak(from, mentioned[0].split('@')[0], argz[1])
} else {
fdciabdul.hideTagKontak(from, argz[0], argz[1])
}
break
case 'tahta':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}tahta teks`, qul)
fdciabdul.sendMediaURL(from, `https://api.zeks.xyz/api/hartatahta?text=${arg}&apikey=apivinz`)
break
case 'pubg':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}pubg teks1|teks2`, qul)
argz = arg.split("|")
if (!argz) return fdciabdul.reply(from, `Penggunaan ${prefix}pubg teks1|teks2`, qul)
axios.get(`https://fdciabdulbot-api.herokuapp.com/api/textmaker/game?text=${argz[0]}&text2=${argz[1]}&theme=pubg&apikey=fdciabdulBot`)
.then((res) => fdciabdul.sendMediaURL(from, res.data.result.url))
.catch((err) => {
console.log(err)
fdciabdul.reply(from, mess.error.api, qul)
})
break
case 'togif':
if (!isQuotedSticker) return reply(from, 'Reply stiker nya', qul)
if (qul.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.isAnimated === true){
const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia)
const uploadn = await uptonaufal(media, Date.now() + '.webp')
const anjj = await axios.get(`http://nzcha-apii.herokuapp.com/webp-to-mp4?url=${uploadn.result.image}`)
thumb = await fdciabdul.getBuffer(anjj.data.result)
fdciabdul.sendGif(from, thumb)
fs.unlinkSync(media)
} else {
fdciabdul.reply(from, `Harus sticker bergerak`, qul)
}
break
case 'toimg': case 'tovideo':
if (!isQuotedSticker) return fdciabdul.reply(from, 'Reply stiker nya', qul)
if (qul.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.isAnimated === true){
const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia)
const uploadn = await uptonaufal(media, Date.now() + '.webp')
const anjj = await axios.get(`http://nzcha-apii.herokuapp.com/webp-to-mp4?url=${uploadn.result.image}`)
await fdciabdul.sendMediaURL(from, anjj.data.result, 'Nih')
fs.unlinkSync(media)
} else {
const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia)
ran = fdciabdul.getRandom('.png')
exec(`ffmpeg -i ${media} ${ran}`, (err) => {
fs.unlinkSync(media)
if (err) {
fdciabdul.reply(from, `gagal`, qul)
fs.unlinkSync(ran)
} else {
buffer = fs.readFileSync(ran)
fdciabdul.sendImage(from, buffer, 'nih', qul)
fs.unlinkSync(ran)
}
})
}
break
case 'shutdown':
await fdciabdul.FakeTokoForwarded(from, `Bye...`, fake)
await fdciabdul.sleep(5000)
fdciabdul.close()
break
case 'spam':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}spam teks|jumlahspam`, qul)
argz = arg.split("|")
if (!argz) return fdciabdul.reply(from, `Penggunaan ${prefix}spam teks|jumlah`, qul)
if (isNaN(argz[1])) return fdciabdul.reply(from, `harus berupa angka`, qul)
for (let i = 0; i < argz[1]; i++){
fdciabdul.sendText(from, argz[0])
}
break
case 'promote':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}promote @tag atau nomor`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
await fdciabdul.FakeTokoForwarded(from, `sukses`, fake)
fdciabdul.promote(from, mentioned)
} else {
await fdciabdul.FakeTokoForwarded(from, `sukses`, fake)
fdciabdul.promote(from, [args[0] + '@s.whatsapp.net'])
}
break
case 'demote':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}demote @tag atau nomor`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
await fdciabdul.FakeTokoForwarded(from, `sukses`, fake)
fdciabdul.demote(from, mentioned)
} else {
await fdciabdul.FakeTokoForwarded(from, `sukses`, fake)
fdciabdul.demote(from, [args[0] + '@s.whatsapp.net'])
}
break
case 'kick':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}kick @tag atau nomor`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
await fdciabdul.FakeTokoForwarded(from, `Bye...`, fake)
fdciabdul.kick(from, mentioned)
} else {
await fdciabdul.FakeTokoForwarded(from, `Bye...`, fake)
fdciabdul.kick(from, [args[0] + '@s.whatsapp.net'])
}
break
case 'add':
if (!arg) return fdciabdul.reply(from, `Penggunaan ${prefix}kick 628xxxx`, qul)
fdciabdul.add(from, [args[0] + '@s.whatsapp.net'])
fdciabdul.FakeTokoForwarded(from, `Sukses`, fake)
break
case 'upstatus':
if (!arg) return fdciabdul.reply(from, `Penggunaan \n${prefix}upstatus text\n${prefix}upstatus caption <reply atau kirim video / img>`, qul)
if (isMedia && !qul.message.videoMessage || isQuotedImage) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia)
fdciabdul.upImgStatus(media, arg).then(() => { fdciabdul.FakeTokoForwarded(from, 'Sukses', fake) })
} else if ((isMedia || isQuotedVideo )) {
const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await fdciabdul.downloadAndSaveMediaMessage(encmedia)
fdciabdul.upVidStatus(media, arg).then(() => { fdciabdul.FakeTokoForwarded(from, 'Sukses', fake) })
} else {
await fdciabdul.upTextStatus(arg).then(() => { fdciabdul.FakeTokoForwarded(from, 'Sukses', fake) })
}
break
case 'getgrup': case 'getgroup': case 'getg':
const ingfo = await fdciabdul.getGroup(totalchat)
let txt = `Ingfo grup\nJumlah Grup: ${ingfo.length}\n\n`
for (let i = 0; i < ingfo.length; i++){
txt += `Nama grup : ${ingfo[i].subject}\nID grup : ${ingfo[i].id}\nDibuat : ${moment(`${ingfo[i].creation}` * 1000).tz('Asia/Jakarta').format('DD/MM/YYYY HH:mm:ss')}\nJumlah Peserta : ${ingfo[i].participants.length}\n\n`
}
fdciabdul.FakeTokoForwarded(from, txt, fake)
break
case 'creategrup': case 'creategroup': case 'createg':
argz = arg.includes('|')
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
let anji = await fdciabdul.createGroup(argz[0], mentioned)
fdciabdul.FakeTokoForwarded(from, JSON.stringify(anji), fake)
} else {
fdciabdul.reply(from, `Penggunaan ${prefix}creategrup namagrup|@tag`, qul)
}
break
case 'imgtourl': case 'tourl':
const encmediiia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const mediaq = await fdciabdul.downloadAndSaveMediaMessage(encmediiia)
const upli = await uptotele(mediaq)
fdciabdul.reply(from, `${upli}`, qul)
fs.unlinkSync(mediaq)
break
default:
if (chats.startsWith('>')){
console.log(color('[EVAL]'), color(moment(qul.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`Eval brooo`))
return fdciabdul.reply(from, JSON.stringify(eval(chats.slice(2)), null, 2), qul)
}
break
}
} catch (err) {
console.log(color('[ERROR]', 'red'), err)
}
})