forked from KillovSky/Iris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
4406 lines (4011 loc) · 278 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. (Desconheço 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.
* P.S: Plagiar este BOT significa estar vendendo a alma para Lucas R. - KillovSky! ;D
*
* 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 moment = require('moment-timezone')
const sinesp = require('sinesp-api')
const { Aki } = require('aki-api')
const request = require('request')
const canvacord = require('canvacord')
const canvas = require('canvas')
const ffmpeg = require('fluent-ffmpeg')
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")
const youtubedl = require('youtube-dl-exec')
const sharp = require('sharp')
const acrcloud = require("acrcloud")
const Pokemon = require('pokemon.js')
// Bomber, se desejar desativar o auto-abrir navegador leia a página inicial da Íris na github
const { bomber } = require("bomber-api")
// UTILIDADES
const { poll, gaming, color, sleep, isUrl, upload, addFilter, isFiltered, translate, isInt } = require('./lib/functions')
const config = require('./lib/config/Gerais/config.json')
const { mylang } = require('./lib/lang')
const options = { headless: true, userDataDir: "./logs/Chrome/Maker", args: ['--aggressive-cache-discard', '--disable-application-cache', '--disable-cache', '--disable-offline-load-stale-cache', '--disable-setuid-sandbox', '--disk-cache-size=0', '--ignore-certificate-errors', '--no-sandbox', '--single-process'] } // Leia a functions.js para maiores detalhes
// JSON'S
const functions = JSON.parse(fs.readFileSync('./lib/config/Gerais/functions.json'))
const ctmprefix = JSON.parse(fs.readFileSync('./lib/config/Gerais/prefix.json'))
const nivel = JSON.parse(fs.readFileSync('./lib/config/Gerais/level.json'))
const custom = JSON.parse(fs.readFileSync('./lib/config/Gerais/custom.json'))
const cmds = JSON.parse(fs.readFileSync('./lib/config/Gerais/cmds.json'))
const hail = JSON.parse(fs.readFileSync('./lib/config/Gerais/greetings.json'))
const guildlimit = JSON.parse(fs.readFileSync('./lib/config/Gerais/limit.json'))
// ATIVADORES & CONFIGS EXTRAS
Pokemon.setLanguage('english');var region = config.Language
const aki = new Aki(region);const akinit = async () => { await aki.start() }
akinit().catch((error) => { console.log(color('[AKI]', 'crimson'), color(`→ Obtive erros ao iniciar o akinator → ${error.message}.`, 'gold')) })
var mess = mylang(region);moment.tz.setDefault('America/Sao_Paulo').locale('pt_BR')
const emoji = new EmojiAPI();var jogadas = 0; var isMuteAll = 0; var oneImage = 0; var oneLink = 0; var oneTrava = 0; var isTyping = []; var noLimits = 0
axios.defaults.headers.common['User-Agent'] = config.User_Agent
const acr = new acrcloud({ host: config.Acr_Host, access_key: config.Acr_Access, access_secret: config.Acr_Secret })
var thePlayerGame = 0; var thePlayerGame2 = 0; var thePlayerGameOld = 0; var thePlayerGameOld2 = 0; var xjogadas = []; var ojogadas = []; var waitJogo = 0; var timesPlayed = 0; var tictacplays = ["a1", "a2", "a3", "b1", "b2", "b3", "c1", "c2", "c3"]; var tttboard = { a1: 'A1', a2: 'A2', a3: 'A3', b1: 'B1', b2: 'B2', b3: 'B3', c1: 'C1', c2: 'C2', c3: 'C3' }; var finalAwnser = 0;var isValidGame = 0
module.exports = kconfig = async (kill, message) => {
// 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
const groupId = isGroupMsg ? chat.groupMetadata.id : ''
var prefix = config.Prefix
for (let i = 0; i < ctmprefix.length; i++) { if (Object.keys(ctmprefix[i]) == groupId) { prefix = Object.values(ctmprefix[i]);break } }
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 & Daily
var daily = JSON.parse(fs.readFileSync('./lib/config/Gerais/diario.json'))
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 = ownerNumber.includes(user)
const isBot = user === `${botNumber}@c.us`
const groupMembers = isGroupMsg ? await kill.getGroupMembers(groupId) : false
const groupMembersId = isGroupMsg ? await kill.getGroupMembersId(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 ? functions[0].nsfw.includes(groupId) : false
const autoSticker = isGroupMsg ? functions[0].sticker.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 = config.User_Agent
const isBlocked = blockNumber.includes(user)
const isAntiPorn = isGroupMsg ? functions[0].antiporn.includes(groupId) : false
const isAntiTravas = isGroupMsg ? functions[0].antitrava.includes(groupId) : false
const isAntiLink = isGroupMsg ? functions[0].antilinks.includes(groupId) : false
const isxp = isGroupMsg ? functions[0].xp.includes(groupId) : false
const mute = isGroupMsg ? functions[0].silence.includes(groupId) : false
const pvmte = !isGroupMsg ? functions[0].silence.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 isQuotedAudio = quotedMsg && quotedMsg.type === 'audio'
const isQuotedPtt = quotedMsg && quotedMsg.type === 'ptt'
const isImage = type === 'image'
const isVideo = type === 'video'
const isAudio = type === 'audio'
const isPtt = type === 'ptt'
const isGif = mimetype === 'image/gif'
const arqs = body.trim().split(' ')
const arks = args.join(' ')
const isTrava = type === 'oversized'
const aMemberS = isGroupMsg ? groupMembers[Math.floor(Math.random() * groupMembers.length)] : user
const randomMember = isGroupMsg ? aMemberS.id : user
// OUTRAS
const side = Math.floor(Math.random() * 2) + 1
var lvpc = Math.floor(Math.random() * 100) + 1
const lvrq = 100 - lvpc
const milSort = Math.floor(Math.random() * 1000) + 1
global.pollfile = `config_vote-${groupId.replace('@c.us', '')}.json`
global.voterslistfile = `vote_poll-${groupId.replace('@c.us', '')}.json`
const errorurl = 'https://img.wallpapersafari.com/desktop/1920/1080/19/44/evOxST.jpg'
const errorImg = 'https://i.ibb.co/jRCpLfn/user.png'
const irisMsgs = await fs.readFileSync('./lib/config/Utilidades/reply.txt').toString().split('\n')
const chatBotR = irisMsgs[Math.floor(Math.random() * irisMsgs.length)].replace('%name$', `${name}`).replace('%battery%', `${lvpc}`)
const lgbt = await fs.readFileSync('./lib/config/Utilidades/lgbt.txt').toString().split('\n')
const guei = lgbt[Math.floor(Math.random() * lgbt.length)]
const weaponC = await fs.readFileSync('./lib/config/Utilidades/armas.txt').toString().split('\n')
const whatWeapon = weaponC[Math.floor(Math.random() * weaponC.length)]
const checkLvL = await gaming.getValue(user, nivel, 'level')
const patente = await gaming.getPatent(checkLvL)
const getReqXP = (theRcvLvL) => { return Number(config.XP_Difficulty) * Math.pow(theRcvLvL, 2) * Number(config.XP_Difficulty) + 1000 }
const valueRand = (value) => { const valres = value[Math.floor(Math.random() * value.length)];return valres }
const tagsPorn = await fs.readFileSync('./lib/config/Utilidades/porn.txt').toString().split('\n')
const theTagPorn = tagsPorn[Math.floor(Math.random() * tagsPorn.length)]
const aWorldCits = await fs.readFileSync('./lib/config/Utilidades/frases.txt').toString().split('\n')
const theCitacion = aWorldCits[Math.floor(Math.random() * aWorldCits.length)]
const getBrain = await fs.readFileSync('./lib/config/Utilidades/curiosidades.txt').toString().split('\n')
const thisKillCats = getBrain[Math.floor(Math.random() * getBrain.length)]
const bibleal = await fs.readFileSync('./lib/config/Utilidades/biblia.txt').toString().split('\n')
const randomBible = bibleal[Math.floor(Math.random() * bibleal.length)]
const fml = await fs.readFileSync('./lib/config/Utilidades/fml.txt').toString().split('\n')
const fmylife = fml[Math.floor(Math.random() * fml.length)]
const letmeHpy = await fs.readFileSync('./lib/config/Utilidades/cantadas.txt').toString().split('\n')
const getHappyness = letmeHpy[Math.floor(Math.random() * letmeHpy.length)]
const neverT = await fs.readFileSync('./lib/config/Utilidades/never.txt').toString().split('\n')
const getNeverland = neverT[Math.floor(Math.random() * neverT.length)]
const getChifre = await fs.readFileSync('./lib/config/Utilidades/corno.txt').toString().split('\n')
const howGado = getChifre[Math.floor(Math.random() * getChifre.length)]
// Sistema que permite ignorar comandos de um grupo, caso você já possua um BOT nele e queira deixar a Íris desligada apenas lá, basta ativar
/*if (isGroupMsg && isCmd && !isOwner && !isBot && groupId == 'Insira a id do grupo') return*/
// Muda a linguagem para a requisitada no comando newlang
if (isGroupMsg && isCmd && functions[0].en.includes(groupId)) { mess = mylang('en') }
if (isGroupMsg && isCmd && functions[0].es.includes(groupId)) { mess = mylang('es') }
if (isGroupMsg && isCmd && functions[0].pt.includes(groupId)) { mess = mylang('pt') }
// Ensina a rodar comandos pelo WhatsApp da BOT
if (isBot && isCmd && chatId !== `${botNumber}@c.us`) await kill.reply(ownerNumber[0], mess.howtorun(`wa.me/+${botNumber}`), id)
// Mantém a BOT escrevendo caso o dono queira
if (isGroupMsg && isTyping.includes(groupId) || isCmd) await kill.simulateTyping(from, true)
// Sistema do XP - Baseado no de Bocchi - Slavyan
if (isGroupMsg && isxp && !gaming.isWin(user) && !isBlocked) {
try {
await gaming.wait(user);var gainedXP = Math.floor(Math.random() * Number(config.Max_XP_Earn)) + Number(config.Min_XP_Earn);const usuarioLevel = await gaming.getValue(user, nivel, 'level')
if (functions[0].companions.includes(user)) { gainedXP = parseInt(gainedXP + (usuarioLevel * 5), 10) } // Beneficio de guilda Companions, XP 5x mais
if (functions[0].thieves.includes(user)) { gainedXP = parseInt(gainedXP + (usuarioLevel * 3), 10) } // Beneficio de guilda Thieves, XP 3x mais
await gaming.addValue(user, Number(gainedXP), nivel, 'xp')
const haveXptoUp = await gaming.getValue(user, nivel, 'xp')
if (getReqXP(checkLvL) <= haveXptoUp) {
await gaming.addValue(user, 1, nivel, 'level');await gaming.addValue(user, Number(config.Iris_Coin), nivel, 'coin')
await kill.reply(from, `*「 +1 NIVEL 」*\n\n➸ *Nome:* ${pushname}\n➸ *XP:* ${await gaming.getValue(user, nivel, 'xp')} / ${getReqXP(checkLvL)}\n➸ *Level:* ${checkLvL} -> ${await gaming.getValue(user, nivel, 'level')} 🆙 \n➸ *Í-Coin:* ${await gaming.getValue(user, nivel, 'coin')}\n➸ *Patente:* *${patente}* 🎉`, id)
// Desative ou Apague a "kill.reply" acima se sua Íris floodar mensagens de "Level UP"
}
} catch (err) { console.log(color('[XP]', 'crimson'), err) }
}
// Adiciona nível caso tenha ganhado XP demais
const justCheckLvL = await gaming.getValue(user, nivel, 'level')
const justCheckXP = await gaming.getValue(user, nivel, 'xp')
if (justCheckXP >= getReqXP(justCheckLvL)) { await gaming.addValue(user, 1, nivel, 'level') }
// Anti Imagens pornográficas
if (isGroupMsg && !isGroupAdmins && isBotGroupAdmins && isAntiPorn && isMedia && isImage && !isCmd && !isOwner && oneImage == 0 && !isBot) {
try {
oneImage = 1; 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.API_DeepAI)
const resp = await deepai.callStandardApi("nsfw-detector", { image: `${getUrl}` })
if (resp.output.nsfw_score > 0.85) {
await kill.removeParticipant(groupId, user).then(async () => { await kill.sendTextWithMentions(from, mess.baninjusto(user) + 'Porno.') })
console.log(color('[NSFW]', 'red'), color(`A imagem contém traços de conteúdo adulto, removerei o → ${pushname} - [${user}]...`, 'yellow'));return oneImage = 0
} else { console.log(color('[SEM NSFW]', 'lime'), color(`→ A imagem não parece ser pornográfica.`, 'gold'));oneImage = 0 }
} catch (error) { return oneImage = 0 }
}
// Auto-stickers de fotos
if (isGroupMsg && autoSticker && isMedia && isImage && !isCmd && !isBot) {
const mediaData = await decryptMedia(message, uaOverride)
await kill.sendImageAsSticker(from, `data:${mimetype};base64,${mediaData.toString('base64')}`, { author: config.Sticker_Author, pack: config.Sticker_Pack, keepScale: true })
}
// Auto-sticker de videos & gifs
if (isGroupMsg && autoSticker && isMedia && isVideo && !isCmd && !isBot) {
const mediaData = await decryptMedia(message, uaOverride)
await kill.sendMp4AsSticker(from, `data:${mimetype};base64,${mediaData.toString('base64')}`, null, { stickerMetadata: true, pack: config.Sticker_Pack, author: config.Sticker_Author, fps: 10, crop: false, loop: 0 })
}
// Anti links de grupo
if (isGroupMsg && !isGroupAdmins && isBotGroupAdmins && isAntiLink && !isOwner && oneLink == 0 && !isBot) {
try {
if (chats.match(new RegExp(/(https:\/\/chat.whatsapp.com)/gi))) {
oneLink = 1; 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).then(async () => { await kill.sendTextWithMentions(from, mess.baninjusto(user) + 'WhatsApp Link.');return oneLink = 0 })
} else { console.log(color('[ALERTA]', 'yellow'), color('Link de grupo invalido recebido...', 'yellow'));oneLink = 0 }
}
} catch (error) { return oneLink = 0 }
}
// Bloqueia todas as travas, seja contato, localização, texto e outros
if (isGroupMsg && isAntiTravas && isTrava && !isGroupAdmins && isBotGroupAdmins && !isOwner && oneTrava == 0 && !isBot) {
try {
oneTrava = 1; console.log(color('[TRAVA]', 'red'), color(`Possível trava recebida pelo → ${pushname} - [${user.replace('@c.us', '')}] em ${name}...`, 'yellow'))
let wakeAdm = 'ACORDA - WAKE UP ADM\n\n'
var shrekDes = ''
for (let i = 0; i < 20; i++) { shrekDes += `⡴⠑⡄⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣤⣀⡀\n⡇⠀⠿⠀⠀⠀⣀⡴⢿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀\n⠀⠀⠀⢄⣠⠾⠁⣀⣄⡈⠙⣿⣿⣿⣿⣿⣿⣿⣿⣆\n⠀⠀⠀⢀⡀⠁⠀⠀⠈⠙⠛⠂⠈⣿⣿⣿⣿⣿⠿⡿⢿⣆\n⠀⠀⢀⡾⣁⣀⠀⠴⠂⠙⣗⡀⠀⢻⣿⣿⠭⢤⣴⣦⣤⣹⠀⠀⠀⢴⣆ \n⠀⢀⣾⣿⣿⣿⣷⣮⣽⣾⣿⣥⣴⣿⣿⡿⢂⠔⢚⡿⢿⣿⣦⣴⣾⠁⡿ \n⢀⡞⠁⠙⠻⠿⠟⠉⠀⠛⢹⣿⣿⣿⣿⣿⣌⢤⣼⣿⣾⣿⡟⠉\n⣾⣷⣶⠇⠀⠀⣤⣄⣀⡀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇\n⠉⠈⠉⠀⠀⢦⡈⢻⣿⣿⣿⣶⣶⣶⣶⣤⣽⡹⣿⣿⣿⣿⡇\n⠀⠀⠀⠀⠀⠀⠉⠲⣽⡻⢿⣿⣿⣿⣿⣿⣿⣷⣜⣿⣿⣿⡇\n⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣷⣶⣮⣭⣽⣿⣿⣿⣿⣿⣿⣿\n⠀⠀⠀⠀⠀⣀⣀⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇\n⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃\n⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠁\n⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠻⠿⠿⠿⠿⠛⠉\n\n` }
for (let adminls of groupAdmins) { wakeAdm += `➸ @${adminls.replace(/@c.us/g, '')}\n` }
await kill.removeParticipant(groupId, user).then(async () => { await kill.setGroupToAdminsOnly(groupId, true) }) // Fecha só para admins e bane o cara que travou
await kill.sendText(from, shrekDes, id).then(async () => { await kill.sendTextWithMentions(from, wakeAdm) }) // Anti-Trava BR do Shrek muahauhauha + Chamar ADMS
await kill.sendTextWithMentions(from, mess.baninjusto(user) + 'Travas.').then(async () => { await kill.sendText(from, mess.nopanic(), id) }) // Manda o motivo do ban e explica para os membros
await kill.sendText(ownerNumber[0], mess.recTrava(user) + `\nAt/No > ${name}`).then(async () => { await kill.contactBlock(user) }) // Avisa o dono do bot e bloqueia o cara
await kill.setGroupToAdminsOnly(groupId, false);return oneTrava = 0 // Reabre o grupo
} catch (error) { return oneTrava = 0 }
}
// Bloqueia travas no PV
if (!isGroupMsg && !isOwner && isTrava && !isBot) { await kill.contactBlock(user).then(async () => { await kill.sendText(ownerNumber[0], mess.recTrava(user)) }) }
// Para limpar automaticamente sem você verificar, adicione "await kill.clearChat(chatId)", o mesmo no de grupos.
// Anti links pornográficos
if (isGroupMsg && !isGroupAdmins && isBotGroupAdmins && isAntiPorn && !isOwner && oneLink == 0 && !isBot) {
try {
if (isUrl(chats)) {
oneLink = 1; const inilkn = new URL(chats)
console.log(color('[URL]', 'yellow'), 'URL recebida →', inilkn.hostname)
await 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.replace('@c.us', '')}]...`, 'yellow'))
await kill.removeParticipant(groupId, user).then(async () => { await kill.sendTextWithMentions(from, mess.baninjusto(user) + 'Porno/Porn.');return oneLink = 0 })
} else { console.log(color('[SEM NSFW]', 'lime'), color(`→ O link não possui pornografia.`, 'gold'));oneLink = 0 }
})
}
} catch (error) { return oneLink = 0 }
}
// Impede travas ou textos que tenham mais de 5.000 linhas
if (isGroupMsg && !isGroupAdmins && isBotGroupAdmins && !isOwner && oneTrava == 0 && !isBot) {
try {
if (chats.length > Number(config.Max_Characters)) {
oneTrava = 1; console.log(color('[TRAVA]', 'red'), color(`Possivel trava recebida pelo → ${pushname} - [${user.replace('@c.us', '')}] em ${name}...`, 'yellow'))
await kill.removeParticipant(groupId, user).then(async () => { await kill.sendTextWithMentions(from, mess.baninjusto(user) + 'Travas.') }) // Remove e manda o motivo no grupo
await kill.sendText(ownerNumber[0], mess.recTrava(user)).then(async () => { await kill.contactBlock(user);return oneTrava = 0 }) // Avisa o dono e então bloqueia a pessoa
}
} catch (error) { return oneTrava = 0}
}
// Bloqueia travas no PV que tenham mais de 5.000 linhas
if (!isGroupMsg && !isOwner && !isBot) {
try {
if (chats.length > Number(config.Max_Characters)) {
console.log(color('[TRAVA]', 'red'), color(`Possivel trava recebida pelo → ${pushname} - [${user.replace('@c.us', '')}]...`, 'yellow'))
return await kill.contactBlock(user).then(async () => { await kill.sendText(ownerNumber[0], mess.recTrava(user)) }) // Avisa o dono e bloqueia
}
} 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) && !isBot) return await kill.removeParticipant(groupId, user)*/
// Comandos sem prefix, esse responde se marcar a BOT
if (!isFiltered(from) && !isMedia && !isCmd) { try { if (chats.includes(`@${botNumber.replace('@c.us', '')}`)) { await kill.reply(from, chatBotR, id) } } catch (error) { return } }
// Caso deseje criar siga o estilo disso abaixo, para usar a base remova a /* e a */
/*if (!isFiltered(from) && !isCmd) { try { if (chats.toLowerCase() == 'Mensagem a receber, sem espaços') await kill.reply(from, 'Resposta para enviar', id) } catch (error) { return } }*/
// Se falhar você pode tentar chats.toLowerCase().includes
// Impede comandos em PV'S mutados
if (!isGroupMsg && isCmd && pvmte && !isOwner) 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 && !isGroupAdmins && mute && !isOwner) return console.log(color('> [SILENCE]', 'red'), color(`Ignorando comando de ${name} pois ele está mutado...`, 'yellow'))
// Muta geral, reseta ao reiniciar
if (isCmd && !isOwner && isMuteAll == 1) return console.log(color('> [SILENCE]', 'red'), color(`Ignorando comando de ${pushname} pois os PV'S e Grupos estão mutados...`, 'yellow'))
// Ignora pessoas bloqueadas
if (isBlocked && isCmd && !isOwner) return console.log(color('> [BLOCK]', 'red'), color(`Ignorando comando de ${pushname} - [${user.replace('@c.us', '')}] por ele estar bloqueado...`, 'yellow'))
// Anti Flood para PV'S
if (isCmd && isFiltered(from) && !isGroupMsg && !isOwner) { await gaming.addValue(user, Number(-100), nivel, 'xp'); return console.log(color('> [FLOOD AS]', 'red'), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`"[${prefix}${command.toUpperCase()}] [${args.length}]"`, 'red'), 'DE', color(`"${pushname} - [${user.replace('@c.us', '')}]"`, 'red')) }
// Anti Flood para grupos
if (isCmd && isFiltered(from) && isGroupMsg && !isOwner) { await gaming.addValue(user, Number(-100), nivel, 'xp'); return console.log(color('> [FLOOD AS]', 'red'), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`"[${prefix}${command.toUpperCase()}] [${args.length}]"`, 'red'), 'DE', color(`"${pushname} - [${user.replace('@c.us', '')}]"`, 'red'), 'EM', color(`"${name || formattedTitle}"`)) }
// Contador de Mensagens (em grupo) | Para contar do PV bote sem aspas "isGroupMsg || !isGroupMsg"
if (isGroupMsg) { await gaming.getValue(user, nivel, 'msg');await gaming.addValue(user, 1, nivel, 'msg') }
// 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 "[${prefix}${command.toUpperCase()}]"`), '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 "[${prefix}${command.toUpperCase()}]"`), '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) await addFilter(from) // Para limitar os usuários em vez do grupo, troque o "from" por "user"
switch(command) {
case 'sticker':;case 'fig':;case 'figurinha':;case 'stiker':;case 'f':;case 's':;case 'stickergif':;case 'gif':;case 'g':;case 'gifsticker':
const sharpre = async (mimetype, isCircle, noCut, mediaData) => { await sharp(mediaData).resize({ width: 512, height: 512, fit: 'fill' }).toBuffer().then(async (resizedImageBuffer) => { await kill.sendImageAsSticker(from, `data:${mimetype};base64,${resizedImageBuffer.toString('base64')}`, { author: config.Sticker_Author, pack: config.Sticker_Pack, keepScale: noCut, circle: isCircle }) }) }
if (isMedia && isImage || isQuotedImage) {
await kill.reply(from, mess.wait(), id)
const mediaMessage = isQuotedImage ? quotedMsg : message
const messageMimetype = isQuotedImage ? quotedMsg.mimetype : mimetype
const mediaData = await decryptMedia(mediaMessage, uaOverride)
if (arks.includes('-circle')) { var isCircle = true } else { var isCircle = false }
if (arks.includes('-cut')) { var noCut = false } else { var noCut = true }
if (arks.includes('-fill')) { return await sharpre(messageMimetype, isCircle, noCut, mediaData) }
await kill.sendImageAsSticker(from, `data:${messageMimetype};base64,${mediaData.toString('base64')}`, { author: config.Sticker_Author, pack: config.Sticker_Pack, keepScale: noCut, circle: isCircle })
} else 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: config.Sticker_Pack, author: config.Sticker_Author, fps: 10, crop: false, loop: 0 }).catch(async () => { await kill.reply(from, mess.gifail(), id) })
} else if (args.length == 1) {
await kill.reply(from, mess.wait(), id)
if (isUrl(url)) {
if (arks.includes('-circle')) { var isCircle = true } else { var isCircle = false }
if (arks.includes('-cut')) { var noCut = false } else { var noCut = true }
await kill.sendStickerfromUrl(from, url, { method: 'get' }, { author: config.Sticker_Author, pack: config.Sticker_Pack, keepScale: noCut, circle: isCircle })
} else return await kill.reply(from, mess.nolink(), id)
} else return await kill.reply(from, mess.sticker(), id)
break
case 'ttp':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
await kill.sendStickerfromUrl(from, `https://api.xteam.xyz/ttp?file&text=${encodeURIComponent(body.slice(5))}`, { author: config.Sticker_Author, pack: config.Sticker_Pack, keepScale: true })
break
case 'attp':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
await kill.reply(from, mess.wait(), id)
await kill.sendStickerfromUrl(from, `https://api.xteam.xyz/attp?file&text=${encodeURIComponent(body.slice(6))}`, { author: config.Sticker_Author, pack: config.Sticker_Pack, keepScale: true })
break
case 'wasted':
try {
await kill.reply(from, mess.wait(), id)
if (isImage || isQuotedImage) {
const wastedPict = isQuotedImage ? quotedMsg : message
const getWastedPic = await decryptMedia(wantedPict, uaOverride)
var thePicWasted = await upload(getWastedPic, false)
} else { var thePicWasted = quotedMsg ? await kill.getProfilePicFromServer(quotedMsgObj.sender.id) : (mentionedJidList.length !== 0 ? await kill.getProfilePicFromServer(mentionedJidList[0]) : await kill.getProfilePicFromServer(user)) }
if (thePicWasted == null || typeof thePicWasted === 'object') thePicWasted = errorImg
await canvacord.Canvas.wasted(thePicWasted).then(async (buffer) => { await kill.sendFile(from, `data:image/png;base64,${buffer.toString('base64')}`, `wasted.png`, '', id) })
} catch (error) {
await kill.reply(from, mess.fail(), id)
console.log(color('[WASTED]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
case 'trigger':
try {
await kill.reply(from, mess.wait(), id)
if (isImage || isQuotedImage) {
const triggermd = isQuotedImage ? quotedMsg : message
const upTrigger = await decryptMedia(triggermd, uaOverride)
var getTrigger = await upload(upTrigger, false)
} else { var getTrigger = quotedMsg ? await kill.getProfilePicFromServer(quotedMsgObj.sender.id) : (mentionedJidList.length !== 0 ? await kill.getProfilePicFromServer(mentionedJidList[0]) : await kill.getProfilePicFromServer(user)) }
if (getTrigger == null || typeof getTrigger === 'object') getTrigger = errorImg
await canvacord.Canvas.trigger(getTrigger).then(async (buffer) => { await kill.sendFile(from, `data:image/png;base64,${buffer.toString('base64')}`, `trigger.png`, 'Run...', id) })
} catch (error) {
console.log(color('[TRIGGER]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
await kill.reply(from, mess.fail(), id)
}
break
// LEMBRE-SE, REMOVER CRÈDITO È CRIME E PROIBIDO
case 'about':
await kill.sendFileFromUrl(from, 'https://i.ibb.co/cC5SPKZ/iris.png', 'iris.png', mess.about(), id);await kill.reply(from, mess.everhost(), id)
break
case 'nobg':
if (isImage || isQuotedImage) {
const nobgmd = isQuotedImage ? quotedMsg : message
const mediaData = await decryptMedia(nobgmd, uaOverride)
const imageBase64 = `data:${nobgmd.mimetype};base64,${mediaData.toString('base64')}`
await kill.reply(from, mess.wait(), id)
const base64img = imageBase64
const outFile = `./lib/media/img/${user.replace('@c.us', '')}noBg.png`
var result = await removeBackgroundFromImageBase64({ base64img, apiKey: config.API_RemoveBG, size: 'auto', type: 'auto', outFile })
await fs.writeFile(outFile, result.base64img)
await kill.sendImageAsSticker(from, `data:${nobgmd.mimetype};base64,${result.base64img}`, { pack: config.Sticker_Pack, author: config.Sticker_Author, keepScale: true })
await kill.reply(from, mess.nobgms(), id)
await sleep(10000).then(async () => { await fs.unlinkSync(`./lib/media/img/${user.replace('@c.us', '')}noBg.png`) })
} else return await kill.reply(from, mess.onlyimg(), id)
break
case 'simg':
if (isImage || 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)
const sbrowser = await puppeteer.launch(options)
const spage = await sbrowser.newPage()
await spage.goto('https://www.google.com/searchbyimage?image_url=' + encodeURIComponent(sImgUp))
const simages = await spage.evaluate(() => { return Array.from(document.body.querySelectorAll('div div a h3')).slice(2).map(e => e.parentNode).map(el => ({ url: el.href, title: el.querySelector('h3').innerHTML })) })
await sbrowser.close()
var titleS = `🔎 「 Google Imagens 」 🔎\n\n`
for (let i = 1; i < simages.length; i++) { titleS += `${simages[i].title}\n${simages[i].url}\n\n══════════════════════════════\n\n` }
await kill.reply(from, titleS, id).catch(async () => { await kill.reply(from, mess.upfail(), id) })
} else return await kill.reply(from, mess.onlyimg(), id)
break
case 'upimg':
if (isImage || 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(async () => { await kill.reply(from, mess.upfail(), id) })
} else return await kill.reply(from, mess.onlyimg(), id)
break
case 'getsticker':
if (args.length == 0) return await 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]
if (stkfm == null) return await kill.reply(from, mess.noresult(), id)
await kill.sendStickerfromUrl(from, stkfm, { method: 'get' }, { author: config.Sticker_Author, pack: config.Sticker_Pack, keepScale: true })
break
case 'morte':;case 'death':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'nomes/nombres/names.', id)
const predea = await axios.get(`https://api.agify.io/?name=${encodeURIComponent(args[0])}`)
if (predea.data.age == null) return await kill.reply(from, mess.validname(), id)
await kill.reply(from, mess.death(predea), id)
break
// Botei todas as Tags do Xvideos que achei
case 'oculto':
if (!isGroupMsg) return await kill.reply(from, mess.sogrupo(), id)
await kill.sendTextWithMentions(from, mess.oculto(randomMember, theTagPorn))
break
case 'gender':;case 'genero':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'nomes/nombres/names.', id)
const seanl = await axios.get(`https://api.genderize.io/?name=${encodeURIComponent(args[0])}`)
if (seanl.data.gender == null) return await kill.reply(from, mess.validname(), id)
await kill.reply(from, mess.genero(seanl), id)
break
case 'detector':
if (!isGroupMsg) return await kill.reply(from, mess.sogrupo(), id)
await kill.reply(from, mess.wait(), id)
await kill.sendTextWithMentions(from, mess.gostosa(randomMember))
break
case 'math':
if (args.length == 0) return await 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 await 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 await 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 await 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 await 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 await 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 await 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 await kill.reply(from, mess.nolink(), id)
break
case 'msg':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
await kill.sendText(from, `${body.slice(5)}`)
break
case 'id':
if (!isGroupMsg) return await 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 await kill.reply(from, mess.onoff(), id)
if (args[0].toLowerCase() == 'on') {
if (functions[0].fake.includes(groupId)) return await kill.reply(from, mess.jaenabled(), id)
functions[0].fake.push(groupId)
await fs.writeFileSync('./lib/config/Gerais/functions.json', JSON.stringify(functions))
await kill.reply(from, mess.enabled(), id)
} else if (args[0].toLowerCase() == 'off') {
if (!functions[0].fake.includes(groupId)) return await kill.reply(from, mess.jadisabled(), id)
functions[0].fake.splice(groupId, 1)
await fs.writeFileSync('./lib/config/Gerais/functions.json', JSON.stringify(functions))
await kill.reply(from, mess.disabled(), id)
} else return await kill.reply(from, mess.kldica1(), id)
} else return await kill.reply(from, mess.soademiro(), id)
break
case 'blacklist':
if (isGroupMsg && isGroupAdmins || isGroupMsg && isOwner) {
if (args.length !== 1) return await kill.reply(from, mess.onoff(), id)
if (args[0].toLowerCase() == 'on') {
if (functions[0].blacklist.includes(groupId)) return await kill.reply(from, mess.jaenabled(), id)
functions[0].blacklist.push(groupId)
await fs.writeFileSync('./lib/config/Gerais/functions.json', JSON.stringify(functions))
await kill.reply(from, mess.enabled(), id)
} else if (args[0].toLowerCase() == 'off') {
if (!functions[0].blacklist.includes(groupId)) return await kill.reply(from, mess.jadisabled(), id)
functions[0].blacklist.splice(groupId, 1)
await fs.writeFileSync('./lib/config/Gerais/functions.json', JSON.stringify(functions))
await kill.reply(from, mess.disabled(), id)
} else return await kill.reply(from, mess.kldica1(), id)
} else return await kill.reply(from, mess.soademiro(), id)
break
case 'bklist':
if (isGroupMsg && isGroupAdmins || isGroupMsg && isOwner) {
if (args.length == 0) return await kill.reply(from, mess.onoff(), id)
if (args[0].toLowerCase() == 'on') {
const bkls = body.slice(11) + '@c.us'
if (functions[0].anti.includes(bkls)) return await kill.reply(from, mess.jaenabled(), id)
functions[0].anti.push(bkls)
await fs.writeFileSync('./lib/config/Gerais/anti.json', JSON.stringify(functions))
await kill.reply(from, mess.bkliston(), id)
} else if (args[0].toLowerCase() == 'off') {
const bkls = body.slice(11) + '@c.us'
if (!functions[0].anti.includes(bkls)) return await kill.reply(from, mess.jadisabled(), id)
functions[0].anti.splice(bkls, 1)
await fs.writeFileSync('./lib/config/Gerais/anti.json', JSON.stringify(functions))
await kill.reply(from, mess.bklistoff(), id)
} else return await kill.reply(from, mess.kldica2(), id)
} else return await kill.reply(from, mess.soademiro(), id)
break
case 'onlyadms':
if (!isGroupMsg) return await kill.reply(from, mess.sogrupo(), id)
if (!isGroupAdmins) return await kill.reply(from, mess.soademiro(), id)
if (!isBotGroupAdmins) return await kill.reply(from, mess.botademira(), id)
if (args.length !== 1) return await kill.reply(from, mess.onoff(), id)
if (args[0].toLowerCase() == 'on') {
await kill.setGroupToAdminsOnly(groupId, true).then(async () => { await kill.sendText(from, mess.admson()) })
} else if (args[0].toLowerCase() == 'off') {
await kill.setGroupToAdminsOnly(groupId, false).then(async () => { await kill.sendText(from, mess.admsoff()) })
} else return await kill.reply(from, mess.kldica1(), id)
break
// LEMBRE-SE, REMOVER CREDITO E CRIME E PROIBIDO
case 'legiao':
if (isGroupMsg) return await kill.reply(from, mess.sopv(), id)
await kill.sendLinkWithAutoPreview(from, 'https://bit.ly/3owVJoB', '\nEsse grupo é apenas a recepção do grupo Legião Z, ao entrar leia a descrição, responda as perguntas e aguarde pela chegada de um administrador para te adicionar - siga os passos que ele pedir.')
break
case 'revoke':
if (!isGroupMsg) return await kill.reply(from, mess.sogrupo(), id)
if (!isGroupAdmins) return await kill.reply(from, mess.soademiro(), id)
if (!isBotGroupAdmins) return await kill.reply(from, mess.botademira(), id)
await kill.revokeGroupInviteLink(groupId).then(async () => { await kill.reply(from, mess.revoga(), id) })
break
case 'water':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
try {
if (arks.length >= 16) return await kill.reply(from, 'Max: 10 letras/letters.', id)
await kill.reply(from, mess.wait() + '\n\n20+ s.', id)
const browser = await puppeteer.launch(options)
const page = await browser.newPage()
await page.goto("https://textpro.me/dropwater-text-effect-872.html", { waitUntil: "networkidle2", timeout: 0 }).then(async () => {
await page.waitForSelector('#text-0')
await page.type("#text-0", body.slice(6))
await page.click("#submit")
await sleep(10000) // Aumente se sua conexão for superr lenta
await page.waitForSelector('div[class="thumbnail"] > img')
const divElement = await page.$eval('div[class="thumbnail"] > img', txLogo => txLogo.src)
await kill.sendFileFromUrl(from, divElement, 'neon.jpg', '', id)
await 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 await kill.reply(from, mess.sogrupo(), id)
if (!isGroupAdmins) return await kill.reply(from, mess.soademiro(), id)
if (!isBotGroupAdmins) return await kill.reply(from, mess.botademira(), id)
if (isMedia && type == 'image' || isQuotedImage) {
const dataMedia = isQuotedImage ? quotedMsg : message
const mediaData = await decryptMedia(dataMedia, uaOverride)
const picgp = await kill.getProfilePicFromServer(groupId)
if (picgp == null) { var backup = errorurl } else { var backup = picgp }
await kill.sendFileFromUrl(from, backup, 'group.png', 'Backup', id)
await kill.setGroupIcon(groupId, `data:${mimetype};base64,${mediaData.toString('base64')}`)
} else if (args.length == 1) {
if (!isUrl(url)) { await kill.reply(from, mess.nolink(), id) }
const picgpo = await kill.getProfilePicFromServer(groupId)
if (picgpo == null) { var back = errorurl } else { var back = picgpo }
await kill.sendFileFromUrl(from, back, 'group.png', 'Backup', id)
await kill.setGroupIconByUrl(groupId, url).then(async (r) => (!r && r !== null) ? kill.reply(from, mess.nolink(), id) : kill.reply(from, mess.maked(), id))
} else return await kill.reply(from, mess.onlyimg(), id)
break
case 'img':
if (isQuotedSticker) {
await kill.reply(from, mess.wait(), id)
const mediaData = await decryptMedia(quotedMsg, uaOverride)
await kill.sendFile(from, `data:${quotedMsg.mimetype};base64,${mediaData.toString('base64')}`, '', '', id)
} else return await 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 await 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 = ["kemonomimi", "neko", "ngif", "fox_girl"];
const rnekolc = rnekol[Math.floor(Math.random() * rnekol.length)];
const neko = await axios.get('https://nekos.life/api/v2/img/' + rnekolc)
await kill.sendFileFromUrl(from, `${neko.data.url}`, ``, `🌝`, id)
break
case 'image':
if (args.length == 0) return await 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)]
if (erest == null) return await kill.reply(from, mess.noresult(), id)
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)]
if (flyaoi == null) return await kill.reply(from, mess.noresult(), id)
await kill.sendFileFromUrl(from, flyaoi, '', 'Tururu...', id)
break
// Adicione mais no arquivo fml.txt na pasta config, obs, em inglês
case 'life':
if (region == 'en') return await kill.reply(from, fmylife, id)
await sleep(5000)
await translate(fmylife, region).then(async (lfts) => { await 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 await kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
const wikip = await wiki.search(`${body.slice(6)}`, region)
const wikis = await axios.get(`https://${region}.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).catch(async () => { await kill.reply(from, mess.noresult(), id) })
break
case 'nasa':
const needsTime = args.length !== 0 && args[0].toLowerCase() == '-data' ? `&date=${encodeURIComponent(args[1])}` : '&'
const nasa = await axios.get(`https://api.nasa.gov/planetary/apod?api_key=${config.API_NASA}${needsTime}`)
if (region == 'en') {
if (nasa.data.media_type == 'image') {
await kill.sendFileFromUrl(from, nasa.data.url, '', `\n${nasa.data.date} → ${nasa.data.title}\n\n${nasa.data.explanation}`, id)
} else return await kill.sendYoutubeLink(from, nasa.data.url, `${nasa.data.date} → ${nasa.data.title}\n\n${nasa.data.explanation}`)
} else {
await sleep(4000)
await translate(nasa.data.explanation, region).then(async (result) => {
if (nasa.data.media_type == 'image') {
await kill.sendFileFromUrl(from, nasa.data.url, '', `\n${nasa.data.date} → ${nasa.data.title}\n\n${result}`, id)
} else return await kill.sendYoutubeLink(from, nasa.data.url, `${nasa.data.date} → ${nasa.data.title}\n\n${result}`)
})
}
break
case 'stalkig':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'instagram usernames.', id)
const ig = await axios.get(`https://www.instagram.com/${encodeURIComponent(body.slice(9))}/?__a=1`)
const stkig = JSON.stringify(ig.data)
if (stkig == '{}') return await 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 (region == 'en') return await kill.reply(from, animl.data.fact, id)
await sleep(5000)
await translate(animl.data.fact, 'pt').then(async (result) => { await kill.reply(from, result, id) })
break
case 'sporn':
if (isGroupMsg && !isNsfw) return await kill.reply(from, mess.gpadulto(), id)
if (args.length == 0) return await 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 await kill.reply(from, mess.gpadulto(), id)
if (args.length == 0 || !isUrl(url) || !url.includes('xvideos.com')) return await 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(async () => { await kill.reply(from, mess.nolink() + '\n\nOu falha geral/or failed on download.', id) })
break
// Pediram demais, então trouxe o youtube-dl para os 4 comandos abaixo, mas se ele cair, responsabilidade é de vocês que deixam seus membros floodarem os comandos.
case 'downvideo':
if (args.length == 0 || !isUrl(url)) return await kill.reply(from, mess.nolink(), id)
try {
await kill.reply(from, mess.wait(), id)
await youtubedl(`${url}`, { noWarnings: true, noCallHome: true, noCheckCertificate: true, preferFreeFormats: true, youtubeSkipDashManifest: true, referer: `${url}`, getUrl: true, x: true, format: 'mp4', skipDownload: true, matchFilter: `filesize < ${Number(config.Download_Size)}M` }).then(async (video) => { await kill.sendFileFromUrl(from, video, `downloads.mp4`, `e.e`, id) })
} catch (error) {
await kill.reply(from, mess.verybig(), id)
console.log(color('[DOWNVIDEO]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
// Isso e o de cima somente funciona se o local não precisar de um login.
case 'downaudio':
if (args.length == 0 || !isUrl(url)) return await kill.reply(from, mess.nolink(), id)
try {
await kill.reply(from, mess.wait(), id)
await youtubedl(`${url}`, { noWarnings: true, noCallHome: true, noCheckCertificate: true, preferFreeFormats: true, youtubeSkipDashManifest: true, referer: `${url}`, x: true, audioFormat: 'mp3', o: `./lib/media/audio/d${user.replace('@c.us', '')}${lvpc}.mp3` }).then(async () => { await kill.sendPtt(from, `./lib/media/audio/d${user.replace('@c.us', '')}${lvpc}.mp3`, id) })
await sleep(10000).then(async () => { await fs.unlinkSync(`./lib/media/audio/d${user.replace('@c.us', '')}${lvpc}.mp3`) })
} catch (error) {
await kill.reply(from, mess.verybig(), id)
if (fs.existsSync(`./lib/media/audio/d${user.replace('@c.us', '')}${lvpc}.mp3`)) { await fs.unlinkSync(`./lib/media/audio/d${user.replace('@c.us', '')}${lvpc}.mp3`) }
console.log(color('[DOWNAUDIO]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
// Se obter erros com o 'replace' apague a "${user.replace('@c.us', '')}" de todos os comandos de download que o possuem.
case 'play':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'Títulos do YouTube/YouTube Titles.', id)
try {
await kill.reply(from, mess.wait(), id)
const ytres = await ytsearch(`${body.slice(6)}`)
await kill.sendYoutubeLink(from, `${ytres.all[0].url}`, '\n' + mess.play(ytres))
await youtubedl(`https://youtu.be/${ytres.all[0].videoId}`, { noWarnings: true, noCallHome: true, noCheckCertificate: true, preferFreeFormats: true, youtubeSkipDashManifest: true, referer: `https://youtu.be/${ytres.all[0].videoId}`, x: true, audioFormat: 'mp3', o: `./lib/media/audio/${user.replace('@c.us', '')}${lvpc}.mp3` }).then(async () => { await kill.sendPtt(from, `./lib/media/audio/${user.replace('@c.us', '')}${lvpc}.mp3`, id) })
await sleep(10000).then(async () => { await fs.unlinkSync(`./lib/media/audio/${user.replace('@c.us', '')}${lvpc}.mp3`) })
} catch (error) {
await kill.reply(from, mess.verybig(), id)
if (fs.existsSync(`./lib/media/audio/${user.replace('@c.us', '')}${lvpc}.mp3`)) { await fs.unlinkSync(`./lib/media/audio/${user.replace('@c.us', '')}${lvpc}.mp3`) }
console.log(color('[PLAY]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
// Se os comandos caírem por seus membros não escutarem meus avisos, não venha dizer que não avisei e pedir uma correção, sem contar que floodar pode danificar você e seu PC.
case 'video':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'Títulos do YouTube/YouTube Titles.', id)
try {
await kill.reply(from, mess.wait(), id)
const vipres = await ytsearch(`${body.slice(7)}`)
await kill.sendYoutubeLink(from, `${vipres.all[0].url}`, '\n' + mess.play(vipres))
await youtubedl(`https://www.youtube.com/watch?v=${vipres.all[0].videoId}`, { noWarnings: true, noCallHome: true, noCheckCertificate: true, preferFreeFormats: true, youtubeSkipDashManifest: true, referer: `https://www.youtube.com/watch?v=${vipres.all[0].videoId}`, getUrl: true, x: true, format: 'mp4', skipDownload: true, matchFilter: `filesize < ${Number(config.Download_Size)}M` }).then(async (video) => { await kill.sendFileFromUrl(from, video, `${vipres.all[0].title}.mp4`, `${vipres.all[0].title}`, id) })
} catch (error) {
await kill.reply(from, mess.verybig(), 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 await kill.reply(from, mess.noargs() + 'Títulos do YouTube/YouTube Titles.', id)
await kill.reply(from, mess.wait(), id)
const ytvrz = await ytsearch(`${body.slice(10)}`)
await kill.sendYoutubeLink(from, `${ytvrz.all[0].url}`, '\n' + mess.play(ytvrz))
break
case 'qr':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
await kill.sendFileFromUrl(from, `http://api.qrserver.com/v1/create-qr-code/?data=${body.slice(4)}`, '', mess.maked(), id)
break
case 'readqr':
if (isImage || isQuotedImage) {
const qrCode = isQuotedImage ? quotedMsg : message
const downQr = await decryptMedia(qrCode, uaOverride)
const upQrCode = await upload(downQr, false)
const getQrText = await axios.get(`http://api.qrserver.com/v1/read-qr-code/?fileurl=${upQrCode}`)
const theQRText = getQrText.data[0].symbol[0].data
if (theQRText == null) return await kill.reply(from, 'Not a QR - Não é um QR.\n\nOu erro - Or error.', id)
await kill.reply(from, `→ ${theQRText}`, id).catch(async () => { await kill.reply(from, mess.upfail(), id) })
} else return await kill.reply(from, mess.onlyimg() + '\nQR-Code!', id)
break
case 'send':
if (args.length == 0 || !isUrl(url)) return await kill.reply(from, mess.nolink(), id)
await kill.sendFileFromUrl(from, url, '', '', id).catch(async () => { await kill.reply(from, mess.onlyimg(), id) })
break
case 'quote':
if (args.length <= 1 || !arks.includes('|')) return await kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.' + '\n\n' + mess.argsbar() + 'use 1 "|".', id)
await kill.reply(from, mess.wait(), id)
const quoteimg = await axios.get(`https://terhambar.com/aw/qts/?kata=${encodeURIComponent(arg.split('|')[0])}&author=${encodeURIComponent(arg.split('|')[1])}&tipe=random`)
await kill.sendFileFromUrl(from, `${quoteimg.data.result}`, '', 'Compreensível.', id)
break
case 'translate':
if (args.length == 0) return await 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)
await translate(quoteText, args[0]).then(async (result) => { await kill.reply(from, `→ ${result}`, quotedMsgObj.id) })
} else {
const txttotl = body.slice(14)
await sleep(5000)
await translate(txttotl, args[0]).then(async (result) => { await 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 await kill.reply(from, mess.noargs() + 'palavras/words/números/numbers.', id)
try {
const dataText = body.slice(8)
var langtts = args[0]
if (args[0].toLowerCase() == 'br') langtts = 'pt-br'
var idptt = tts(langtts)
await idptt.save(`./lib/media/audio/res${idptt}${lvpc}.mp3`, dataText, async () => {
await sleep(3000)
await kill.sendPtt(from, `./lib/media/audio/res${idptt}${lvpc}.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.reply(from, mess.idiomas(), id)
break
case 'resposta':
if (args.length == 0) return await kill.reply(from, mess.noargs() + 'palavras/words/números/numbers/emojis/etc.', id)
await 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[0].replace('@c.us', '')}\n🌙 - Dev: Lucas R. - KillovSkyᴸᶻ [https://github.com/KillovSky/Iris]`, id)
await kill.reply(from, mess.everhost(), id)
break
case 'akinator':;case 'aki':
try {
if (args[0].toLowerCase() == '-r') {
let akinm = args[1].match(/^[0-9]+$/)
if (!akinm) return await 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].toLowerCase() == '-back' || args[0].toLowerCase() == '-new') {
for (let i = 0; i < jogadas; i++) { await aki.back() }
jogadas = 0
await kill.reply(from, mess.akistart(aki), id)
} else return await kill.reply(from, mess.akistart(aki), id)
} catch (error) {
await kill.reply(from, mess.akifail(), id)
akinit()
await kill.reply(from, mess.akistart(aki), id)
console.log(color('[AKINATOR]', 'crimson'), color(`→ Obtive erros no comando ${prefix}${command} → ${error.message} - Você pode ignorar.`, 'gold'))
}
break
// Se quiser adicione respostas na reply.txt ou use o comando '/resposta', Íris também consegue adicionar ela mesma sozinha
case 'iris':
if (args.length == 0) return await kill.reply(from, chatBotR, id)
try {
if (args[0].toLowerCase() == '-g') {
await exec(`cd lib/config/Utilidades && bash -c 'grep -i "${args[1]}" reply.txt | shuf -n 1'`, async (error, stdout, stderr) => {
if (error || stderr || stdout == null || stdout == '') {
await kill.reply(from, chatBotR, id)
} else return await kill.reply(from, stdout, id)
})
} else {
const iris = await axios.get(`http://simsumi.herokuapp.com/api?text=${encodeURIComponent(body.slice(6))}&lang=${region}`)
if (iris.data.success == 'Limit 50 queries per hour.' || iris.data.success == '' || iris.data.success == null) {
await kill.reply(from, chatBotR, id)
} else {
if (iris.data.success == 'Curta a pagina Gamadas por Bieber no facebook ;)') return await kill.reply(from, 'Oi sua gostosa, como vai?', id)
await kill.reply(from, iris.data.success, id)
await fs.appendFile('./lib/config/Utilidades/reply.txt', `\n${iris.data.success}`)
}