forked from KillovSky/Iris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
3556 lines (3022 loc) · 170 KB
/
config.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
/* ----------- VERY IMPORTANT NOTICE - AVISO MUITO IMPORTANTE - AVISO MUY IMPORTANTE ------------------
*
* Construído por Lucas R. - KillovSky, agradecimentos especiais ao grupo Legião Z.
*
* Reprodução, edição e outros estão autorizados MAS SEM REMOVER MEUS CRÉDITOS.
* Caso remova, resulta na quebra da licença do mesmo, o que é um crime federal.
* Leia mais em http://escolhaumalicenca.com.br/licencas/mit/ ou no comando /termos.
*
* Desculpe pelos comandos que estão em "inglês" como o "/groupinfo", amo o inglês!
* Então os programo dessa forma. (Desconheco palavras suficientes em português) :'D
*
* Plagiar meus comandos não te torna coder, vá estudar, não seja um ladrão miserável.
* Levei meses nesse projeto e não paro de me empenhar em deixar todos felizes.
* Então você gostaria de ter algo que se esforçou muito de GRAÇA roubado de você? Pois eu não.
*
* Se ainda planeja roubar, saiba que eu espero de coração que você nunca seja roubado.
*
* Obrigado a todos que me apoiam, que não roubam isso, que pegam e põem os créditos e...
*
* Obrigado a você que escolheu a Íris.
*
* ---------------------------------------------------------------------------------------------------*/
// MODULOS
const { decryptMedia } = require('@open-wa/wa-decrypt')
const fs = require('fs-extra')
const axios = require('axios')
const math = require('mathjs')
const { search } = require("simple-play-store-search")
const google = require('google-it')
const isPorn = require('is-porn')
const imgsearch = require('node-reverse-image-search')
const moment = require('moment-timezone')
const sinesp = require('sinesp-api')
const { Aki } = require('aki-api')
const request = require('request')
const canvas = require('canvacord')
const { spawn, exec, execFile } = require('child_process')
const nhentai = require('nhentai-js')
const { API } = require('nhentai-api')
const { removeBackgroundFromImageBase64 } = require('remove.bg')
const fetch = require('node-fetch')
const ms = require('parse-ms')
const ytsearch = require('yt-search')
const removeAccents = require('remove-accents')
const { stdout } = require('process')
const bent = require('bent')
const tts = require('node-gtts')
const brainly = require('brainly-scraper-v2')
const deepai = require('deepai')
const wiki = require("@dada513/wikipedia-search")
const { EmojiAPI } = require("emoji-api");
const os = require('os')
const puppeteer = require('puppeteer')
const { XVDL } = require("xvdl")
// UTILIDADES
const { color, sleep, ss, isUrl, upload, addFilter, isFiltered, translate } = require('./lib/functions')
const { getLevel, getMsg, getXp, addLevel, addXp, getRank, isWin, wait, addLimit, addMsg, getLimit } = require('./lib/gaming')
const poll = require('./lib/poll')
const config = require('./lib/config/Bot/config.json')
const { mylang } = require('./lib/lang')
// ATIVADORES & CONFIGS
const region = config.lang
const aki = new Aki(region)
const playaki = async () => { try { await aki.start() } catch (error) { console.log(color('[A]', 'crimson'), color(`→ Obtive erros ao iniciar o akinator → ${error.message} - Você pode ignorar.`, 'gold')) } }
playaki()
const cd = 0.18e+7
const mess = mylang()
moment.tz.setDefault('America/Sao_Paulo').locale('pt_BR')
const emoji = new EmojiAPI();
var jogadas = 0
// JSON'S
const nsfw_ = JSON.parse(fs.readFileSync('./lib/config/Grupos/NSFW.json'))
const welkom = JSON.parse(fs.readFileSync('./lib/config/Grupos/welcome.json'))
const atporn = JSON.parse(fs.readFileSync('./lib/config/Grupos/antiporn.json'))
const bklist = JSON.parse(fs.readFileSync('./lib/config/Grupos/blacklist.json'))
const xp = JSON.parse(fs.readFileSync('./lib/config/Grupos/xp.json'))
const nivel = JSON.parse(fs.readFileSync('./lib/config/Bot/level.json'))
const atbk = JSON.parse(fs.readFileSync('./lib/config/Bot/anti.json'))
const daily = JSON.parse(fs.readFileSync('./lib/config/Bot/diario.json'))
const faki = JSON.parse(fs.readFileSync('./lib/config/Grupos/fake.json'))
const slce = JSON.parse(fs.readFileSync('./lib/config/Bot/silence.json'))
const atstk = JSON.parse(fs.readFileSync('./lib/config/Grupos/sticker.json'))
const msgcount = JSON.parse(fs.readFileSync('./lib/config/Bot/msgcount.json'))
const atlinks = JSON.parse(fs.readFileSync('./lib/config/Grupos/antilinks.json'))
module.exports = kconfig = async (kill, message) => {
// Prefix
const prefix = config.prefix
// Isso antes da try possibilita receber os alertas no WhatsApp
const { type, id, from, t, sender, author, isGroupMsg, chat, chatId, caption, isMedia, mimetype, quotedMsg, quotedMsgObj, mentionedJidList } = message
let { body } = message
const ownerNumber = config.owner
const chats = (type === 'chat') ? body : ((type === 'image' || type === 'video')) ? caption : ''
body = (type === 'chat' && body.startsWith(prefix)) ? body : (((type === 'image' || type === 'video') && caption) && caption.startsWith(prefix)) ? caption : ''
const comma = body.slice(1).trim().split(/ +/).shift().toLowerCase()
const command = removeAccents(comma)
try {
// PARAMETROS
const { name, formattedTitle } = chat
let { pushname, verifiedName, formattedName } = sender
pushname = pushname || verifiedName || formattedName
const botNumber = await kill.getHostNumber()
const blockNumber = await kill.getBlockedIds()
const user = sender.id
const isOwner = user.includes(ownerNumber)
const groupId = isGroupMsg ? chat.groupMetadata.id : ''
const groupMembers = isGroupMsg ? await kill.getGroupMembers(groupId) : false
const groupAdmins = isGroupMsg ? await kill.getGroupAdmins(groupId) : ''
const isGroupAdmins = isGroupMsg ? groupAdmins.includes(user) : false
const isBotGroupAdmins = isGroupMsg ? groupAdmins.includes(botNumber + '@c.us') : false
const isNsfw = isGroupMsg ? nsfw_.includes(groupId) : false
const autoSticker = isGroupMsg ? atstk.includes(groupId) : false
const time = moment(t * 1000).format('DD/MM HH:mm:ss')
const processTime = (timestamp, now) => { return moment.duration(now - moment(timestamp * 1000)).asSeconds() }
const arg = body.trim().substring(body.indexOf(' ') + 1)
const args = body.trim().split(/ +/).slice(1)
const isCmd = body.startsWith(prefix)
const url = args.length !== 0 ? args[0] : ''
const uaOverride = process.env.UserAgent
const isBlocked = blockNumber.includes(user)
const isAntiPorn = isGroupMsg ? atporn.includes(groupId) : false
const isAntiLink = isGroupMsg ? atlinks.includes(groupId) : false
const isxp = isGroupMsg ? xp.includes(groupId) : false
const mute = isGroupMsg ? slce.includes(groupId) : false
const pvmte = !isGroupMsg ? slce.includes(user) : false
const isQuotedImage = quotedMsg && quotedMsg.type === 'image'
const isQuotedVideo = quotedMsg && quotedMsg.type === 'video'
const isQuotedSticker = quotedMsg && quotedMsg.type === 'sticker'
const isQuotedGif = quotedMsg && quotedMsg.mimetype === 'image/gif'
const isImage = type === 'image'
const isVideo = type === 'video'
const isGif = mimetype === 'image/gif'
const arqs = body.trim().split(' ')
const arks = args.join(' ')
// OUTRAS
const double = Math.floor(Math.random() * 2) + 1
const lvpc = Math.floor(Math.random() * 100) + 1
global.pollfile = 'poll_Config_' + groupId + '.json'
global.voterslistfile = 'poll_voters_Config_' + groupId + '.json'
const errorurl = 'https://img.wallpapersafari.com/desktop/1920/1080/19/44/evOxST.jpg'
const errorImg = 'https://i.ibb.co/jRCpLfn/user.png'
// Sobe patente por nivel, mude pro que quiser dentro das aspas, não esqueca do case ranking
const check = getLevel(user, nivel)
var patente = 'Cobre'
if (check <= 4) {
patente = 'Bronze I'
} else if (check <= 10) {
patente = 'Bronze II'
} else if (check <= 15) {
patente = 'Bronze III'
} else if (check <= 20) {
patente = 'Bronze IV'
} else if (check <= 25) {
patente = 'Bronze V'
} else if (check <= 30) {
patente = 'Prata I'
} else if (check <= 35) {
patente = 'Prata II'
} else if (check <= 40) {
patente = 'Prata III'
} else if (check <= 45) {
patente = 'Prata IV'
} else if (check <= 50) {
patente = 'Prata V'
} else if (check <= 55) {
patente = 'Ouro I'
} else if (check <= 60) {
patente = 'Ouro II'
} else if (check <= 65) {
patente = 'Ouro III'
} else if (check <= 70) {
patente = 'Ouro IV'
} else if (check <= 75) {
patente = 'Ouro V'
} else if (check <= 80) {
patente = 'Diamante I'
} else if (check <= 85) {
patente = 'Diamante II'
} else if (check <= 90) {
patente = 'Diamante III'
} else if (check <= 95) {
patente = 'Diamante IV'
} else if (check <= 100) {
patente = 'Diamante V'
} else if (check <= 200) {
patente = 'Diamante Mestre'
} else if (check <= 300) {
patente = 'Elite'
} else if (check <= 400) {
patente = 'Global'
} else if (check <= 500) {
patente = 'Herói'
} else if (check <= 600) {
patente = 'Lendário'
} else if (check <= 700) {
patente = 'Semi-Deus'
} else if (check <= 800) {
patente = 'Arcanjo'
} else if (check <= 900) {
patente = 'Demoníaco'
} else if (check <= 1000 || check >= 1000) {
patente = 'Divindade'
}
// Sistema do XP - Baseado no de Bocchi - Slavyan
if (isGroupMsg && isxp && !isWin(user) && !isBlocked) {
try {
wait(user)
const levelAtual = getLevel(user, nivel)
const xpAtual = Math.floor(Math.random() * 30) + 11 // XP de 10 a 40
const neededXp = 5 * Math.pow(levelAtual, 2) + 50 * levelAtual + 100
addXp(user, xpAtual, nivel)
if (neededXp <= getXp(user, nivel)) {
addLevel(user, 1, nivel)
const userLevel = getLevel(user, nivel)
const takeXp = 5 * Math.pow(userLevel, 2) + 50 * userLevel + 100
await kill.reply(from, `*「 +1 NIVEL 」*\n\n➸ *Nome*: ${pushname}\n➸ *XP*: ${getXp(user, nivel)} / ${takeXp}\n➸ *Level*: ${levelAtual} -> ${getLevel(user, nivel)} 🆙 \n➸ *Patente*: *${patente}* 🎉`, id)
}
} catch (err) { console.log(color('[XP]', 'crimson'), err) }
}
// Anti links de grupo
if (isGroupMsg && !isGroupAdmins && isBotGroupAdmins && isAntiLink && !isOwner) {
try {
if (chats.match(new RegExp(/(https:\/\/chat.whatsapp.com)/gi))) {
const gplka = await kill.inviteInfo(chats)
if (gplka) {
console.log(color('[BAN]', 'red'), color('Link de grupo detectado, removendo participante...', 'yellow'))
await kill.removeParticipant(groupId, user)
} else { console.log(color('[ALERTA]', 'yellow'), color('Link de grupo invalido recebido...', 'yellow')) }
}
} catch (error) { return }
}
// Anti links pornograficos
if (isGroupMsg && !isGroupAdmins && isBotGroupAdmins && isAntiPorn && !isOwner) {
try {
if (isUrl(chats)) {
const inilkn = new URL(chats)
console.log(color('[URL]', 'yellow'), 'URL recebida →', inilkn.hostname)
isPorn(inilkn.hostname, async (err, status) => {
if (err) return console.error(err)
if (status) {
console.log(color('[NSFW]', 'red'), color(`O link é pornografico, removerei o → ${pushname} - [${user}]...`, 'yellow'))
await kill.removeParticipant(groupId, user)
} else { console.log(color('[SEM NSFW]', 'green'), color(`→ O link não possui pornografia.`, 'gold')) }
})
}
} catch (error) { return }
}
// Ative para banir quem mandar todos os tipos de links (Ative removendo a /* e */)
/*if (isGroupMsg && !isGroupAdmins && isBotGroupAdmins && isAntiLink && !isOwner && isUrl(chats)) { await kill.removeParticipant(groupId, user) }*/
// Anti Imagens pornograficas, tirar o isCmd quebra diversos comandos de imagens
if (isGroupMsg && !isGroupAdmins && isBotGroupAdmins && !isOwner && isAntiPorn && isMedia && isImage && !isCmd) {
try {
console.log(color('[IMAGEM]', 'red'), color('Verificando a imagem por pornografia...', 'yellow'))
const mediaData = await decryptMedia(message, uaOverride)
const getUrl = await upload(mediaData, false)
deepai.setApiKey(config.deepai)
const resp = await deepai.callStandardApi("nsfw-detector", { image: `${getUrl}` })
if (resp.output.nsfw_score >= 0.70) {
await kill.removeParticipant(groupId, user)
console.log(color('[NSFW]', 'red'), color(`A imagem contém traços de contéudo adulto, removerei o → ${pushname} - [${user}]...`, 'yellow'))
} else { console.log(color('[SEM NSFW]', 'green'), color(`→ A imagem não aparententa ser pornografica.`, 'gold')) }
} catch (error) { return }
}
// Impede travas ou textos que tenham mais de 5.000 linhas
if (isGroupMsg && !isGroupAdmins && !isOwner && isBotGroupAdmins) {
try {
if (chats.length > 5000) {
await kill.sendTextWithMentions(from, mess.antitrava(user))
await kill.removeParticipant(groupId, user)
await kill.contactBlock(user) // Caso sua bot não seja imune
}
} catch (error) { return }
}
// Impede comandos em PV'S mutados
if (!isGroupMsg && isCmd && !isOwner && pvmte) return console.log(color('[SILENCE]', 'red'), color(`Ignorando comando de ${pushname} - [${user.replace('@c.us', '')}] pois ele está mutado...`, 'yellow'))
// Impede comandos em grupos mutados
if (isGroupMsg && isCmd && !isOwner && !isGroupAdmins && mute) return console.log(color('[SILENCE]', 'red'), color(`Ignorando comando de ${name} pois ele está mutado...`, 'yellow'))
// Ignora pessoas bloqueadas
if (isBlocked && !isOwner && isCmd) return console.log(color('[BLOCK]', 'red'), color(`Ignorando comando de ${pushname} - [${user.replace('@c.us', '')}] por ele estar bloqueado...`, 'yellow'))
// Auto-stickers de fotos
if (isGroupMsg && autoSticker && isMedia && isImage && !isCmd) {
const mediaData = await decryptMedia(message, uaOverride)
const imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}`
await kill.sendImageAsSticker(from, imageBase64, { author: '🎁 https://bit.ly/30t4jJV ☆', pack: '🔰 Iris/Legião Z ⚜️', keepScale: true })
}
// Auto-sticker de videos & gifs
if (isGroupMsg && autoSticker && isMedia && isVideo && !isCmd) {
const mediaData = await decryptMedia(message, uaOverride)
const videoBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}`
await kill.sendMp4AsSticker(from, videoBase64, null, { stickerMetadata: true, pack: '🔰 Iris/Legião Z ⚜️', author: '🎁 https://bit.ly/30t4jJV ☆', fps: 30, startTime: '00:00:00.0', endTime : '00:00:05.0', crop: true, loop: 0 })
}
// Anti Flood para PV'S
if (isCmd && isFiltered(from) && !isGroupMsg && !isOwner) { return console.log(color('FLOOD AS', 'red'), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`), 'de', color(`${pushname} - [${user.replace('@c.us', '')}]`)) }
// Anti Flood para grupos
if (isCmd && isFiltered(from) && isGroupMsg && !isOwner) { return console.log(color('FLOOD AS', 'red'), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`), 'de', color(`${pushname} - [${user.replace('@c.us', '')}]`), 'em', color(name || formattedTitle)) }
// Contador de Mensagens (em grupo)
if (isGroupMsg) { getMsg(user, msgcount); addMsg(user, 1, msgcount) }
// Mensagens no PV
if (!isCmd && !isGroupMsg) { return console.log('> MENSAGEM AS', color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), 'de', color(`${pushname} - [${user.replace('@c.us', '')}]`)) }
// Mensagem em Grupo
if (!isCmd && isGroupMsg) { return console.log('> MENSAGEM AS', color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), 'de', color(`${pushname} - [${user.replace('@c.us', '')}]`), 'em', color(name || formattedTitle)) }
// Comandos no PV
if (isCmd && !isGroupMsg) { console.log(color(`> COMANDO "${command} [${args.length}]" AS`), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), 'de', color(`${pushname} - [${user.replace('@c.us', '')}]`)) }
// Comandos em grupo
if (isCmd && isGroupMsg) { console.log(color(`> COMANDO "${command} [${args.length}]" AS`), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), 'de', color(`${pushname} - [${user.replace('@c.us', '')}]`), 'em', color(name || formattedTitle)) }
// Impede SPAM
if (isCmd && !isOwner) addFilter(from)
switch(command) {
case 'sticker':
case 'fig':
case 'figurinha':
case 'stiker':
if (isMedia && isImage) {
const mediaData = await decryptMedia(message, uaOverride)
const imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}`
await kill.sendImageAsSticker(from, imageBase64, { author: '🎁 https://bit.ly/30t4jJV ☆', pack: '🔰 Iris/Legião Z ⚜️', keepScale: true })
} else if (isQuotedImage) {
const mediaData = await decryptMedia(quotedMsg, uaOverride)
const imageBase64 = `data:${quotedMsg.mimetype};base64,${mediaData.toString('base64')}`
await kill.sendImageAsSticker(from, imageBase64, { author: '🎁 https://bit.ly/30t4jJV ☆', pack: '🔰 Iris/Legião Z ⚜️', keepScale: true })
} else if (args.length == 1) {
if (isUrl(url)) {
await kill.sendStickerfromUrl(from, url, { method: 'get' }, { author: '🎁 https://bit.ly/30t4jJV ☆', pack: '🔰 Iris/Legião Z ⚜️', keepScale: true })
} else return kill.reply(from, mess.nolink(), id)
} else return kill.reply(from, mess.sticker(), id)
break
case 'ttp':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
const ttpst = await axios.get(`https://st4rz.herokuapp.com/api/ttp?kata=${encodeURIComponent(body.slice(5))}`)
await kill.sendImageAsSticker(from, ttpst.data.result, { author: '🎁 https://bit.ly/30t4jJV ☆', pack: '🔰 Iris/Legião Z ⚜️', keepScale: true })
break
case 'attp':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
await kill.reply(from, mess.wait(), id)
await axios.get(`https://api.xteam.xyz/attp?file&text=${encodeURIComponent(body.slice(6))}`, { responseType: 'arraybuffer' }).then(async (response) => {
const attp = Buffer.from(response.data, 'binary').toString('base64')
await kill.sendImageAsSticker(from, attp, { author: '🎁 https://bit.ly/30t4jJV ☆', pack: '🔰 Iris/Legião Z ⚜️', keepScale: true })
})
break
case 'wasted':
if (isMedia && type === 'image' || isQuotedImage) {
await kill.reply(from, mess.wait(), id)
const wastedmd = isQuotedImage ? quotedMsg : message
const wstddt = await decryptMedia(wastedmd, uaOverride)
const wastedUpl = await upload(wstddt, false)
await kill.sendFileFromUrl(from, `https://some-random-api.ml/canvas/wasted?avatar=${wastedUpl}`, 'Wasted.jpg', mess.wasted(), id)
.catch(() => { kill.reply(from, mess.upfail(), id) })
} else return kill.reply(from, mess.onlyimg(), id)
break
case 'trigger':
if (isMedia && type === 'image' || isQuotedImage) {
await kill.reply(from, mess.wait(), id)
const triggermd = isQuotedImage ? quotedMsg : message
const upTrigger = await decryptMedia(triggermd, uaOverride)
const getTrigger = await upload(upTrigger, false)
await axios.get(`https://some-random-api.ml/canvas/triggered?avatar=${getTrigger}`, { responseType: 'arraybuffer' }).then(async (response) => {
const theTigger = Buffer.from(response.data, 'binary').toString('base64')
await kill.sendImageAsSticker(from, theTigger, { author: '🎁 https://bit.ly/30t4jJV ☆', pack: '🔰 Iris/Legião Z ⚜️', keepScale: true })
})
.catch(() => { kill.reply(from, mess.upfail(), id) })
} else return kill.reply(from, mess.onlyimg(), id)
break
// LEMBRE-SE, REMOVER CRÈDITO È CRIME E PROIBIDO
case 'about':
await kill.sendFile(from, './lib/media/img/iris.png', 'iris.png', mess.about(), id)
break
case 'nobg':
if (isMedia && type === 'image' || isQuotedImage) {
const nobgmd = isQuotedImage ? quotedMsg : message
const mediaData = await decryptMedia(nobgmd, uaOverride)
const imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}`
await kill.reply(from, mess.wait(), id)
const base64img = imageBase64
const outFile = './lib/media/img/noBg.png'
var result = await removeBackgroundFromImageBase64({ base64img, apiKey: config.nobg, size: 'auto', type: 'auto', outFile })
await fs.writeFile(outFile, result.base64img)
await kill.sendImageAsSticker(from, `data:${mimetype};base64,${result.base64img}`, { author: '🎁 https://bit.ly/30t4jJV ☆', pack: '🔰 Iris/Legião Z ⚜️', keepScale: true })
await kill.reply(from, mess.nobgms(), id)
} else return kill.reply(from, mess.onlyimg(), id)
break
case 'stickergif':
case 'gifsticker':
case 'gif':
if (isMedia && isVideo || isGif || isQuotedVideo || isQuotedGif) {
await kill.reply(from, mess.wait(), id)
const encryptMedia = isQuotedGif || isQuotedVideo ? quotedMsg : message
const mediaData = await decryptMedia(encryptMedia, uaOverride)
await kill.sendMp4AsSticker(from, mediaData, null, { stickerMetadata: true, pack: '🔰 Iris/Legião Z ⚜️', author: '🎁 https://bit.ly/30t4jJV ☆', fps: 10, startTime: '00:00:00.0', endTime : '00:00:05.0', crop: true, loop: 0 })
.catch(() => { kill.reply(from, mess.gifail(), id) })
} else return kill.reply(from, mess.onlyvgif(), id)
break
case 'simg':
if (isMedia && type === 'image' || isQuotedImage) {
const shimgoh = isQuotedImage ? quotedMsg : message
const mediaData = await decryptMedia(shimgoh, uaOverride)
await kill.reply(from, mess.wait(), id)
const sImgUp = await upload(mediaData, false)
var titleS = `🔎 「 Google Imagens 」 🔎\n\n`
const sendres = async (results) => {
for (let i = 1; i < results.length; i++) { titleS += `${results[i].title}\n${results[i].url}\n\n══════════════════════════════\n\n` }
await kill.reply(from, titleS, id)
}
await sleep(10000)
const resimg = await imgsearch(sImgUp, sendres)
.catch(() => { kill.reply(from, mess.upfail(), id) })
} else return kill.reply(from, mess.onlyimg(), id)
break
case 'upimg':
if (isMedia && type === 'image' || isQuotedImage) {
const upimgoh = isQuotedImage ? quotedMsg : message
const mediaData = await decryptMedia(upimgoh, uaOverride)
const upImg = await upload(mediaData, false)
await kill.reply(from, mess.tempimg(upImg), id)
.catch(() => { kill.reply(from, mess.upfail(), id) })
} else return kill.reply(from, mess.onlyimg(), id)
break
case 'getsticker':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
const stkm = await fetch(`https://api.fdci.se/sosmed/rep.php?gambar=${encodeURIComponent(body.slice(12))}`)
const stimg = await stkm.json()
let stkfm = stimg[Math.floor(Math.random() * stimg.length) + 1]
await kill.sendStickerfromUrl(from, stkfm, { method: 'get' }, { author: '🎁 https://bit.ly/30t4jJV ☆', pack: '🔰 Iris/Legião Z ⚜️', keepScale: true })
break
case 'morte':
case 'death':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'nomes/nombres/names.', id)
const predea = await axios.get(`https://api.agify.io/?name=${encodeURIComponent(args[0])}`)
await kill.reply(from, mess.death(predea), id)
break
case 'oculto':
if (!isGroupMsg) return kill.reply(from, mess.sogrupo(), id)
const surp = groupMembers[Math.floor(Math.random() * groupMembers.length)]
var xvid = ["Negoes branquelos e feministas", `${pushname} se depilando na banheira`, `${pushname} comendo meu cuzinho`, `${pushname} quer me comer o que fazer?`, "lolis nuas e safadas", "Ursinhos Mansos Peludos e excitados", "mae do adm cozida na pressao", "Buceta de 500 cm inflavel da boneca chinesa lolita company", "corno manso batendo uma pra mim com meu rosto na webcam", "tigresa vip da buceta de mel", "belle delphine dando o cuzinho no barzinho da esquina", "fazendo anal no negao", "africanos nus e chupando pau", "anal africano", "comendo a minha tia", "lgbts fazendo ahegao", "adm gostoso tirando a roupa", "gays puxando o intestino pra fora", "Gore de porno de cachorro", "anoes baixinhos do pau grandao", "Anões Gays Dotados Peludos", "anões gays dotados penetradores de botas", "Ursinhos Mansos Peludos", "Jailson Mendes", "Vendo meu Amigo Comer a Esposa", "Golden Shower"]
const surp2 = xvid[Math.floor(Math.random() * xvid.length)]
await kill.sendTextWithMentions(from, mess.oculto(surp, surp2))
await sleep(2000)
break
case 'gender':
case 'genero':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'nomes/nombres/names.', id)
const seanl = await axios.get(`https://api.genderize.io/?name=${encodeURIComponent(args[0])}`)
await kill.reply(from, mess.genero(seanl), id)
break
case 'detector':
if (!isGroupMsg) return kill.reply(from, mess.sogrupo(), id)
await kill.reply(from, mess.wait(), id)
await sleep(3000)
const quem = groupMembers[Math.floor(Math.random() * groupMembers.length)]
await kill.sendTextWithMentions(from, mess.gostosa(quem))
await sleep(2000)
break
case 'math':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'número & simbolos matematicos/numbers & mathematical symbols.', id)
const mtk = body.slice(6)
try {
if (typeof math.evaluate(mtk) !== "number") return kill.reply(from, mess.onlynumber() + '\nUse +, -, *, /', id)
await kill.reply(from, `${mtk}\n\n*=*\n\n${math.evaluate(mtk)}`, id)
} catch (error) {
await kill.reply(from, mess.onlynumber() + '\n+, -, *, /', id)
console.log(color('[MATH]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'inverter':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
await kill.reply(from, `${body.slice(10).split('').reverse().join('')}`, id)
break
case 'contar':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
await kill.reply(from, mess.contar(body, args), id)
break
case 'giphy':
if (args.length !== 1) return kill.reply(from, mess.nolink(), id)
const isGiphy = url.match(new RegExp(/https?:\/\/(www\.)?giphy.com/, 'gi'))
const isMediaGiphy = url.match(new RegExp(/https?:\/\/media.giphy.com\/media/, 'gi'))
if (isGiphy) {
const getGiphyCode = url.match(new RegExp(/(\/|\-)(?:.(?!(\/|\-)))+$/, 'gi'))
if (!getGiphyCode) { return kill.reply(from, mess.fail() + '\n\nGiphy site error.', id) }
const giphyCode = getGiphyCode[0].replace(/[-\/]/gi, '')
const smallGifUrl = 'https://media.giphy.com/media/' + giphyCode + '/giphy-downsized.gif'
await kill.sendGiphyAsSticker(from, smallGifUrl)
} else if (isMediaGiphy) {
const gifUrl = url.match(new RegExp(/(giphy|source).(gif|mp4)/, 'gi'))
if (!gifUrl) { return kill.reply(from, mess.fail() + '\n\nGiphy site error.', id) }
const smallGifUrl = url.replace(gifUrl[0], 'giphy-downsized.gif')
await kill.sendGiphyAsSticker(from, smallGifUrl)
} else return kill.reply(from, mess.nolink(), id)
break
case 'msg':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
await kill.sendText(from, `${body.slice(5)}`)
break
case 'id':
if (!isGroupMsg) return kill.reply(from, mess.sogrupo(), id)
await kill.reply(from, mess.idgrupo(groupId), id)
break
case 'fake':
if (isGroupMsg && isGroupAdmins || isGroupMsg && isOwner) {
if (args.length !== 1) return kill.reply(from, mess.onoff(), id)
if (args[0] == 'on') {
faki.push(groupId)
fs.writeFileSync('./lib/config/Grupos/fake.json', JSON.stringify(faki))
await kill.reply(from, mess.enabled(), id)
} else if (args[0] == 'off') {
faki.splice(groupId, 1)
fs.writeFileSync('./lib/config/Grupos/fake.json', JSON.stringify(faki))
await kill.reply(from, mess.disabled(), id)
} else return kill.reply(from, mess.kldica1(), id)
} else return kill.reply(from, mess.soademiro(), id)
break
case 'blacklist':
if (isGroupMsg && isGroupAdmins || isGroupMsg && isOwner) {
if (args.length !== 1) return kill.reply(from, mess.onoff(), id)
if (args[0] == 'on') {
bklist.push(groupId)
fs.writeFileSync('./lib/config/Grupos/blacklist.json', JSON.stringify(bklist))
await kill.reply(from, mess.enabled(), id)
} else if (args[0] == 'off') {
bklist.splice(groupId, 1)
fs.writeFileSync('./lib/config/Grupos/blacklist.json', JSON.stringify(bklist))
await kill.reply(from, mess.disabled(), id)
} else return kill.reply(from, mess.kldica1(), id)
} else return kill.reply(from, mess.soademiro(), id)
break
case 'bklist':
if (isGroupMsg && isGroupAdmins || isGroupMsg && isOwner) {
if (args.length == 0) return kill.reply(from, mess.onoff(), id)
if (args[0] == 'on') {
const bkls = body.slice(11) + '@c.us'
atbk.push(bkls)
fs.writeFileSync('./lib/config/Bot/anti.json', JSON.stringify(atbk))
await kill.reply(from, mess.bkliston(), id)
} else if (args[0] == 'off') {
const bkls = body.slice(11) + '@c.us'
atbk.splice(bkls, 1)
fs.writeFileSync('./lib/config/Bot/anti.json', JSON.stringify(atbk))
await kill.reply(from, mess.bklistoff(), id)
} else return kill.reply(from, mess.kldica2(), id)
} else return kill.reply(from, mess.soademiro(), id)
break
case 'onlyadms':
if (!isGroupMsg) return kill.reply(from, mess.sogrupo(), id)
if (!isGroupAdmins) return kill.reply(from, mess.soademiro(), id)
if (!isBotGroupAdmins) return kill.reply(from, mess.botademira(), id)
if (args.length !== 1) return kill.reply(from, mess.onoff(), id)
if (args[0] == 'on') {
await kill.setGroupToAdminsOnly(groupId, true).then(() => kill.sendText(from, mess.admson()))
} else if (args[0] == 'off') {
await kill.setGroupToAdminsOnly(groupId, false).then(() => kill.sendText(from, mess.admsoff()))
} else return kill.reply(from, mess.kldica1(), id)
break
// LEMBRE-SE, REMOVER CREDITO E CRIME E PROIBIDO
case 'legiao':
if (isGroupMsg) return kill.reply(from, mess.sopv(), id)
await kill.sendLinkWithAutoPreview(from, 'https://chat.whatsapp.com/H53MdwhtnRf7TGX1VJ2Jje', 'S2')
break
case 'revoke':
if (!isGroupMsg) return kill.reply(from, mess.sogrupo(), id)
if (!isGroupAdmins) return kill.reply(from, mess.soademiro(), id)
if (!isBotGroupAdmins) return kill.reply(from, mess.botademira(), id)
await kill.revokeGroupInviteLink(groupId).then(() => kill.reply(from, mess.revoga(), id))
break
case 'water':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
try {
if (arks.length >= 16) return kill.reply(from, 'Max: 10 letras/letters.', id)
await kill.reply(from, mess.wait() + '\n\n20+ s.', id)
const browser = await puppeteer.launch({ headless: true })
const page = await browser.newPage()
await page.goto("https://textpro.me/dropwater-text-effect-872.html", {waitUntil: "networkidle2" }).then(async () => {
await page.type("#text-0", body.slice(6))
await page.click("#submit")
await new Promise(resolve => setTimeout(resolve, 10000))
const divElement = await page.$( 'div[class="thumbnail"] > img' )
const txLogo = await (await divElement.getProperty("src")).jsonValue()
await kill.sendFileFromUrl(from, txLogo, 'neon.jpg', '', id)
browser.close()
})
} catch (error) {
await kill.reply(from, mess.fail(), id)
console.log(color('[WATER]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'setimage':
if (!isGroupMsg) return kill.reply(from, mess.sogrupo(), id)
if (!isGroupAdmins) return kill.reply(from, mess.soademiro(), id)
if (!isBotGroupAdmins) return kill.reply(from, mess.botademira(), id)
if (isMedia && type == 'image' || isQuotedImage) {
const dataMedia = isQuotedImage ? quotedMsg : message
const _mimetype = dataMedia.mimetype
const mediaData = await decryptMedia(dataMedia, uaOverride)
const imageBase64 = `data:${_mimetype};base64,${mediaData.toString('base64')}`
const picgp = await kill.getProfilePicFromServer(groupId)
if (picgp == undefined) { var backup = errorurl } else { var backup = picgp }
await kill.sendFileFromUrl(from, backup, 'group.png', 'Backup', id)
await kill.setGroupIcon(groupId, imageBase64)
} else if (args.length == 1) {
if (!isUrl(url)) { await kill.reply(from, mess.nolink(), id) }
const picgpo = await kill.getProfilePicFromServer(groupId)
if (picgpo == undefined) { var back = errorurl } else { var back = picgpo }
await kill.sendFileFromUrl(from, back, 'group.png', 'Backup', id)
await kill.setGroupIconByUrl(groupId, url).then((r) => (!r && r !== undefined)
? kill.reply(from, mess.nolink(), id)
: kill.reply(from, mess.maked(), id))
} else return kill.reply(from, mess.onlyimg(), id)
break
case 'img':
if (isQuotedSticker) {
await kill.reply(from, mess.wait(), id)
const mediaData = await decryptMedia(quotedMsg, uaOverride)
const stickerImg = `data:${quotedMsg.mimetype};base64,${mediaData.toString('base64')}`
await kill.sendFile(from, stickerImg, '', '', id)
} else return kill.reply(from, mess.onlyst(), id)
break
case 'randomanime':
const nime = await axios.get('https://api.computerfreaker.cf/v1/anime')
await kill.sendFileFromUrl(from, `${nime.data.url}`, ``, 'e.e', id)
break
case 'frase':
const aiquote = await axios.get("http://inspirobot.me/api?generate=true")
await kill.sendFileFromUrl(from, aiquote.data, 'quote.jpg', '~Ok...?~\n\n❤️', id )
break
case 'make':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
const diary = await axios.get(`https://st4rz.herokuapp.com/api/nulis?text=${encodeURIComponent(body.slice(6))}`)
await kill.sendImage(from, `${diary.data.result}`, '', mess.diary(), id)
break
case 'neko':
const rnekol = ["https://nekos.life/api/v2/img/kemonomimi", "https://nekos.life/api/v2/img/neko", "https://nekos.life/api/v2/img/ngif", "https://nekos.life/api/v2/img/fox_girl"];
const rnekolc = rnekol[Math.floor(Math.random() * rnekol.length)];
const neko = await axios.get(rnekolc)
await kill.sendFileFromUrl(from, `${neko.data.url}`, ``, `🌝`, id)
break
case 'image':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
const linp = await fetch(`https://api.fdci.se/sosmed/rep.php?gambar=${encodeURIComponent(body.slice(7))}`)
const pint = await linp.json()
let erest = pint[Math.floor(Math.random() * pint.length)]
await kill.sendFileFromUrl(from, erest, '', ';)', id)
break
case 'yaoi':
const yam = await fetch(`https://api.fdci.se/sosmed/rep.php?gambar=yaoi`)
const yaoi = await yam.json()
let flyaoi = yaoi[Math.floor(Math.random() * yaoi.length)]
await kill.sendFileFromUrl(from, flyaoi, '', 'Tururu...', id)
break
// Adicione mais no arquivo fml.txt na pasta config, obs, em inglês
case 'life':
const fml = fs.readFileSync('./lib/config/Utilidades/fml.txt').toString().split('\n')
const fmylife = fml[Math.floor(Math.random() * fml.length)]
if (config.lang == 'en') return kill.reply(from, fmylife, id)
await sleep(5000)
translate(fmylife, config.lang).then((lfts) => kill.reply(from, lfts, id))
break
case 'fox':
const fox = await axios.get(`https://some-random-api.ml/img/fox`)
await kill.sendFileFromUrl(from, fox.data.link, ``, '🥰', id)
break
case 'wiki':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
const wikip = await wiki.search(`${body.slice(6)}`, config.lang)
const wikis = await axios.get(`https://${config.lang}.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&pageids=${wikip[0].pageid}`)
const getData = Object.keys(wikis.data.query.pages)
await kill.reply(from, wikis.data.query.pages[getData].extract, id)
break
case 'nasa':
if (args[0] == '-data') {
const nasa = await axios.get(`https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY&date=${encodeURIComponent(args[1])}`)
if (config.lang == 'en') return kill.sendFileFromUrl(from, `${nasa.data.url}`, '', `${nasa.data.date} → ${nasa.data.title}\n\n ${nasa.data.explanation}`, id)
await sleep(4000)
translate(nasa.data.explanation, config.lang).then((result) => kill.sendFileFromUrl(from, `${nasa.data.url}`, '', `${nasa.data.date} → ${nasa.data.title}\n\n ${result}`, id))
} else {
const nasa = await axios.get(`https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY`)
if (config.lang == 'en') return kill.sendFileFromUrl(from, `${nasa.data.url}`, '', `${nasa.data.date} → ${nasa.data.title}\n\n ${nasa.data.explanation}`, id)
await sleep(4000)
translate(nasa.data.explanation, 'pt').then((result) => kill.sendFileFromUrl(from, `${nasa.data.url}`, '', `${nasa.data.date} → ${nasa.data.title}\n\n ${result}`, id))
}
break
case 'stalkig':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'instagram usernames.', id)
const ig = await axios.get(`https://docs-jojo.herokuapp.com/api/stalk?username=${body.slice(9)}`)
const stkig = JSON.stringify(ig.data)
if (stkig == '{}') return kill.reply(from, mess.noresult(), id)
await kill.sendFileFromUrl(from, `${ig.data.graphql.user.profile_pic_url}`, ``, mess.insta(ig), id)
break
case 'fatos':
var anifac = ["dog", "cat", "bird", "panda", "fox", "koala"];
var tsani = anifac[Math.floor(Math.random() * anifac.length)];
const animl = await axios.get(`https://some-random-api.ml/facts/${tsani}`)
if (config.lang == 'en') return kill.reply(from, animl.data.fact, id)
await sleep(5000)
translate(animl.data.fact, 'pt').then((result) => kill.reply(from, result, id))
break
case 'sporn':
if (isGroupMsg && !isNsfw) return kill.reply(from, mess.gpadulto(), id)
if (args.length == 0) return kill.reply(from, mess.noargs(), id)
const xxxSearch = await XVDL.search(body.slice(7))
const sPornX = await XVDL.getInfo(xxxSearch.videos[0].url)
await kill.sendFileFromUrl(from, `${xxxSearch.videos[0].thumbnail.static}`, '', mess.sporn(xxxSearch, sPornX), id)
break
case 'xvideos':
if (isGroupMsg && !isNsfw) return kill.reply(from, mess.gpadulto(), id)
if (args.length == 0 || !isUrl(url) || !url.includes('xvideos.com')) return kill.reply(from, mess.nolink(), id)
await kill.reply(from, mess.wait(), id)
const sPornD = await XVDL.getInfo(url)
await kill.sendFileFromUrl(from, `${sPornD.streams.lq}`, 'xvideos.mp4', `🌚`, id)
.catch(() => { kill.reply(from, mess.nolink() + '\n\nOu falha geral/or failed on download.', id) })
break
case 'fb':
if (args.length == 0 || !isUrl(url) || !url.includes('facebook.com')) return kill.reply(from, mess.nolink(), id)
try {
const fb = await axios.get(`https://mnazria.herokuapp.com/api/fbdownloadervideo?url=${encodeURIComponent(url)}`)
await kill.sendFileFromUrl(from, `${fb.data.resultSD}`, 'video.mp4', '❤️ ~? 🤔 ?~', id)
} catch (error) {
await kill.reply(from, mess.serveroff(), id)
console.log(color('[FACEBOOK]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'mp3':
if (args.length == 0 || !isUrl(url) || !url.includes('youtu')) return kill.reply(from, mess.nolink(), id)
try {
const ytmp3d = await axios.get(`http://st4rz.herokuapp.com/api/yta2?url=${encodeURIComponent(url)}`)
await kill.sendFileFromUrl(from, `${ytmp3d.data.result}`, `${ytmp3d.data.title}.${ytmp3d.data.ext}`, `${ytmp3d.data.title}`, id)
} catch (error) {
await kill.reply(from, mess.serveroff(), id)
console.log(color('[MP3]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'mp4':
if (args.length == 0 || !isUrl(url) || !url.includes('youtu')) return kill.reply(from, mess.nolink(), id)
await kill.reply(from, mess.wait(), id)
try {
const ytmp4d = await axios.get(`http://st4rz.herokuapp.com/api/ytv2?url=${encodeURIComponent(url)}`)
await kill.sendFileFromUrl(from, `${ytmp4d.data.result}`, `${ytmp4d.data.title}.${ytmp4d.data.ext}`, `${ytmp4d.data.title}`, id)
} catch (error) {
await kill.reply(from, mess.serveroff(), id)
console.log(color('[MP4]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'play':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'Títulos do YouTube/YouTube Titles.', id)
try {
const ytres = await ytsearch(`${body.slice(6)}`)
await kill.sendFileFromUrl(from, `${ytres.all[0].image}`, ``, mess.play(ytres), id)
const asize = await axios.get(`http://st4rz.herokuapp.com/api/yta?url=https://www.youtube.com/watch?v=${ytres.all[0].videoId}`)
const apeso = asize.data.filesize.replace(' MB', '')
if (apeso >= 16 || asize.data.filesize.endsWith('GB')) return kill.reply(from, mess.verybig(asize), id)
const asend = await axios.get(`http://st4rz.herokuapp.com/api/yta2?url=https://www.youtube.com/watch?v=${ytres.all[0].videoId}`)
await kill.sendFileFromUrl(from, `${asend.data.result}`, `${asend.data.title}.${asend.data.ext}`, `${asend.data.title}`, id)
} catch (error) {
await kill.reply(from, mess.serveroff(), id)
console.log(color('[PLAY]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'video':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'Títulos do YouTube/YouTube Titles.', id)
try {
const vipres = await ytsearch(`${body.slice(6)}`)
await kill.sendFileFromUrl(from, `${vipres.all[0].image}`, ``, mess.play(vipres), id)
const vsize = await axios.get(`http://st4rz.herokuapp.com/api/ytv?url=https://www.youtube.com/watch?v=${vipres.all[0].videoId}`)
const vpeso = vsize.data.filesize.replace(' MB', '')
if (vpeso >= 16 || vsize.data.filesize.endsWith('GB')) return kill.reply(from, mess.verybig(vsize), id)
const vsend = await axios.get(`http://st4rz.herokuapp.com/api/ytv2?url=https://www.youtube.com/watch?v=${vipres.all[0].videoId}`)
await kill.sendFileFromUrl(from, `${vsend.data.result}`, `${vsend.data.title}.${vsend.data.ext}`, `${vsend.data.title}`, id)
} catch (error) {
await kill.reply(from, mess.serveroff(), id)
console.log(color('[VIDEO]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'ytsearch':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'Títulos do YouTube/YouTube Titles.', id)
const ytvrz = await ytsearch(`${body.slice(10)}`)
await kill.sendYoutubeLink(from, `${ytvrz.all[0].url}`, mess.play(ytvrz))
break
case 'qr':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
await kill.sendFileFromUrl(from, `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${body.slice(4)}`, '', mess.maked(), id)
break
case 'send':
if (args.length == 0 || !isUrl(url)) return kill.reply(from, mess.nolink(), id)
await kill.sendFileFromUrl(from, url, '', '', id).catch(() => kill.reply(from, mess.onlyimg(), id))
break
case 'quote':
if (args.length <= 1 | !arks.includes('|')) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.' + '\n\n' + mess.argsbar() + 'use 1 "|".', id)
const quotes = arg.split('|')[0]
const qauth = arg.split('|')[1]
await kill.reply(from, mess.wait(), id)
const quoteimg = await axios.get(`https://terhambar.com/aw/qts/?kata=${encodeURIComponent(quotes)}&author=${encodeURIComponent(qauth)}&tipe=random`)
await kill.sendFileFromUrl(from, `${quoteimg.data.result}`, '', 'Compreensivel.', id)
break
case 'translate':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'idioma/language & words/palavras ou/or marca/mark a message/mensagem.', id)
await kill.reply(from, mess.wait(), id)
try {
if (quotedMsg) {
const quoteText = quotedMsg.type == 'chat' ? quotedMsg.body : quotedMsg.type == 'image' ? quotedMsg.caption : ''
await sleep(5000)
translate(quoteText, args[0]).then((result) => kill.reply(from, `→ ${result}`, quotedMsgObj.id))
} else {
const txttotl = body.slice(14)
await sleep(5000)
translate(txttotl, args[0]).then((result) => kill.reply(from, `→ ${result}`, id))
}
} catch (error) {
await kill.reply(from, mess.ttsiv() + '\n\nOu' + mess.gblock(), id)
console.log(color('[TRANSLATE]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'tts':
if (args.length <= 1) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
try {
const dataText = body.slice(8)
var langtts = args[0]
if (args[0] == 'br') langtts = 'pt-br'
var idptt = tts(langtts)
idptt.save(`./lib/media/tts/res${idptt}.mp3`, dataText, async () => {
await sleep(3000)
await kill.sendPtt(from, `./lib/media/tts/res${idptt}.mp3`, id)
})
} catch (error) {
await kill.reply(from, mess.ttsiv(), id)
console.log(color('[TTS]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'idiomas':
await kill.sendText(from, mess.idiomas())
break
case 'resposta':
if (args.length == 0) return kill.reply(from, mess.noargs() + 'palavras/words/números/numbers/emojis/etc.', id)
fs.appendFile('./lib/config/Utilidades/reply.txt', `\n${body.slice(10)}`)
await kill.reply(from, mess.maked(), id)
break
case 'criador':
await kill.reply(from, `☀️ - Host: https://wa.me/${config.owner.replace('@c.us', '')}\n🌙 - Dev: https://wa.me/5518998044132`, id)
break
case 'akinator':
case 'aki':
try {
if (args[0] == '-r') {
let akinm = args[1].match(/^[0-9]+$/)
if (!akinm) return kill.reply(from, mess.aki(), id)
const myAnswer = `${args[1]}`
await aki.step(myAnswer);
jogadas = jogadas + 1
if (aki.progress >= 90 || aki.currentStep >= 90) {
await aki.win()
var akiwon = aki.answers[0]
await kill.sendFileFromUrl(from, `${akiwon.absolute_picture_path}`, '', mess.akiwon(aki, akiwon), id)
} else { await kill.reply(from, mess.akistart(aki), id) }
} else if (args[0] == '-back' || args[0] == '-new') {
for (let i = 0; i < jogadas; i++) {
await aki.back()
}
jogadas = 0
await kill.reply(from, mess.akistart(aki), id)
} else return kill.reply(from, mess.akistart(aki), id)
} catch (error) {