-
Notifications
You must be signed in to change notification settings - Fork 0
/
ramal.js
1904 lines (1690 loc) · 105 KB
/
ramal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
const Discord = require("discord.js");
const ayarlar = require('./ayarlar.json')
const matthe = require('./ayar.json')
const client = new Discord.Client();
let express = require('express');
client.on("guildBanAdd", async function (guild, user) {
const entry = await guild
.fetchAuditLogs({ type: "MEMBER_BAN_ADD" })
.then(audit => audit.entries.first());
const yetkili = await guild.members.cache.get(entry.executor.id);
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
guild.members.ban(entry.executor.id, { reason: "Shera ban Koruma" })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Ban Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**Sunucudan Bir Kullanıcı Yasaklandı!**
**Yetkili Bilgisi**
**${yetkili.user.tag}** **||** **${yetkili.id}**
**Kullanıcı Bilgisi**
**${user.tag}** **||** **${user.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucudan Bir Kullanıcı İzinsiz Yasaklandı!** \n**Yasaklıyan Ve Yasaklanan Kişilerin Bilgileri** \n**Yetkilinin Adı :** \`\`${yetkili.user.tag}\`\` **Yetkilinin İdsi :** \`\`${yetkili.id}\`\`\n**Kullanıcın Adı :** \`\`${user.tag}\`\` **Kullanıcının İdsi :** \`\`${user.id}\`\``)
});
client.on("guildMemberRemove", async kickhammer => {
const guild = kickhammer.guild;
const entry = await guild
.fetchAuditLogs()
.then(audit => audit.entries.first());
if (entry.action == `MEMBER_KICK`) {
let yetkili = await guild.members.cache.get(entry.executor.id);
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
kickhammer.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
kickhammer.guild.members.ban(yetkili.id, { reason: "Shera kick koruma" })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Kick Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**Sunucudan Bir Kullanıcı İzinsiz Kicklendi!**
**Yetkili Bilgisi**
**${yetkili.user.tag}** **||** **${yetkili.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucudan Bir Kullanıcı İzinsiz Kicklendi!** \n**Kickleyen Kişinin Bilgileri** \n**Yetkilinin Adı :** \`\`${yetkili.user.tag}\`\` **Yetkilinin İdsi :** \`\`${yetkili.id}\`\``)
}
});
client.on("guildMemberAdd", async member => {
const entry = await member.guild
.fetchAuditLogs({ type: "BOT_ADD" })
.then(audit => audit.entries.first());
const xd = entry.executor;
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
if (member.user.bot) {
member.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
member.guild.members.ban(entry.executor.id, { reason: "Shera Bot Koruma" })
member.guild.members.ban(member.id, { reason: "Shera Bot Koruma" })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Bot Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**Sunucuya İzinsiz Bot Eklendi!**
**Yetkili Bilgisi**
**${xd.tag}** **||** **${xd.id}**
**Botun Bilgisi**
**${member.user.tag}** **||** **${member.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucuya Bir Bot Eklendi! Eklenen Botun Bilgileri Ve Ekliyen Kişinin Bilgileri :** \n**Botun Adı :** \`\`${member.user.tag}\`\` **Botun İdsi :** \`\`${member.id}\`\` \n**Kullanıcı Adı :** \`\`${xd.tag}\`\` **Kullanıcı İdsi :** \`\`${xd.id}\`\``)
}
});
client.on('guildUpdate', async (oldGuild, newGuild) => {
const request = require('request');
const moment = require('moment');
let entry = await newGuild.fetchAuditLogs({ type: 'GUILD_UPDATE' }).then(audit => audit.entries.first());
if (!entry.executor || entry.executor.id === client.user.id || Date.now() - entry.createdTimestamp > 10000) return;
moment.locale('tr');
if (newGuild.vanityURLCode === null) return; // URL yoksa bişi yapmasın.
if (oldGuild.vanityURLCode === newGuild.vanityURLCode) return; // URL'ler aynıysa bişi yapmasın.
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;// Youtube: Matthe
if (matthe.guvenlid.includes(entry.executor.id)) return;
newGuild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
newGuild.members.ban(entry.executor.id, { reason: "Shera URL Koruma" })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('URL Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**Sunucu Ayarlarıyla Oynandı!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
client.users.cache.get(ayarlar.sahip).send(`**Sunucu URL'si değiştirildi! Değiştiren kişinin bilgileri :**\n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdisi :** \`\`${entry.executor.id}\`\``)
request({
method: 'PATCH',
url: `https://discord.com/api/v8/guilds/${newGuild.id}/vanity-url`,
body: {
code: ayarlar.url
},
json: true,
headers: {
"Authorization": `Bot ${ayarlar.token1}`
}
}, (err, res, body) => {
if (err) {
return console.log(err);
}
});
});
client.on("guildUpdate", async (oldGuild, newGuild) => {
let entry = await newGuild.fetchAuditLogs({ type: 'GUILD_UPDATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
if (newGuild.name !== oldGuild.name) newGuild.setName(oldGuild.name);
newGuild.setIcon(oldGuild.iconURL({ dynamic: true, size: 2048 }));
newGuild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
newGuild.members.ban(entry.executor.id, { reason: `Shera Güncelleme Koruma` });
const moment = require('moment');
moment.locale('tr');
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Sunucu Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**Sunucu Ayarlarıyla Oynandı!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucu ayarlarıyla Oynandı! Oynıyan Kişinin Bilgileri :**\n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\``)
});
client.on("roleDelete", async role => {
let entry = await role.guild.fetchAuditLogs({ type: 'ROLE_DELETE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
role.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
role.guild.members.ban(entry.executor.id, { reason: `Shera Rol Silme Koruma` });
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Rol Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**Sunucuda Rol Silindi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Rol Bilgisi**
**${role.name}** **||** **${role.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucuda rol silindi! silen kişinin bilgileri :** \n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\`\n**Rol Adı :** \`\`${role.name}\`\` **Rol İdsi :** \`\`${role.id}\`\``)
});
client.on("roleCreate", async role => {
let entry = await role.guild.fetchAuditLogs({ type: 'ROLE_CREATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
role.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
role.guild.members.ban(entry.executor.id, { reason: `Shera Rol Oluşturma Koruma` });
role.delete({ reason: "Rol Koruma Sistemi" });
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Rol Açma Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**Sunucuda Rol Açıldı!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucuda rol açıldı! açan kişinin bilgileri :** \n**Kullanıcı Adıı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\``)
});
client.on("roleUpdate", async (oldRole, newRole) => {
let entry = await newRole.guild.fetchAuditLogs({ type: 'ROLE_UPDATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
if (yetkiPermleri.some(p => !oldRole.permissions.has(p) && newRole.permissions.has(p))) {
newRole.setPermissions(oldRole.permissions);
newRole.guild.roles.cache.filter(r => !r.managed && (r.permissions.has("ADMINISTRATOR") || r.permissions.has("MANAGE_ROLES") || r.permissions.has("MANAGE_GUILD"))).forEach(r => r.setPermissions(36818497));
};
newRole.edit({
name: oldRole.name,
color: oldRole.hexColor,
hoist: oldRole.hoist,
permissions: oldRole.permissions,
mentionable: oldRole.mentionable
});
newRole.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
newRole.guild.members.ban(entry.executor.id, { reason: `Shera Rol Güncelleme Koruma` });
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Rol Günceleme Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**Sunucuda Rol Güncellendi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Rol Bilgisi**
**${oldRole.name}** **||** **${oldRole.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucuda rol güncellendi! Güncelliyen kişinin bilgileri :** \n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\`\n**Rol Adı :**\`\`${oldRole.name}\`\` **Rol İdsi :** \`\`${oldRole.id}\`\``)
});
const yetkiPermleri = ["ADMINISTRATOR", "MANAGE_ROLES", "MANAGE_CHANNELS", "MANAGE_GUILD", "BAN_MEMBERS", "KICK_MEMBERS", "MANAGE_NICKNAMES", "MANAGE_EMOJIS", "MANAGE_WEBHOOKS"];
client.on("guildMemberUpdate", async (oldMember, newMember) => {
if (newMember.roles.cache.size > oldMember.roles.cache.size) {
let entry = await newMember.guild.fetchAuditLogs({ type: 'MEMBER_ROLE_UPDATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
const uyecik = newMember.guild.members.cache.get(entry.executor.id);
if (yetkiPermleri.some(p => !oldMember.hasPermission(p) && newMember.hasPermission(p))) {
newMember.roles.set(oldMember.roles.cache.map(r => r.id));
uyecik.roles.set([ayarlar.karantinarol]).catch(err => { })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Rol Verme Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**İzinsiz Yönetici Rolü Verildi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Kullanıcı Bilgisi**
**${newMember.user.tag}** **||** **${newMember.id}**
**Yetkilinin yetkileri alınıp karantinaya atıldı!**`)
channel.send({ embed: jahky })
};
};
});
client.on("guildMemberUpdate", async (oldMember, newMember) => {
let guild = newMember.guild;
if (oldMember.nickname != newMember.nickname) {
let logs = await guild.fetchAuditLogs({ limit: 5, type: "MEMBER_UPDATE" }).then(e => e.entries.sort((x, y) => y.createdTimestamp - x.createdTimestamp));
let log = logs.find(e => ((Date.now() - e.createdTimestamp) / (1000)) < 5);
if (!log) return;
if (oldMember.user.id === log.executor.id) return
if (matthe.bots.includes(log.executor.id)) return;
if (matthe.owners.includes(log.executor.id)) return;
if (matthe.guvenlid.includes(log.executor.id)) return;
const uyecik = newMember.guild.members.cache.get(log.executor.id);
uyecik.roles.set([ayarlar.karantinarol]).catch(err => { })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('İsim Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**İzinsiz İsim Güncellendi!**
**Yetkili Bilgisi**
**${log.executor.tag}** **||** **${log.executor.id}**
**Kullanıcı Bilgisi**
**${newMember.user.tag}** **||** **${newMember.id}**
**İsim Bilgisi**
**${oldMember.nickname}** **>** **${newMember.nickname}**
**Yetkilinin yetkileri alınıp karantinaya atıldı!**`)
channel.send({ embed: jahky })
return;
}
});
client.on("channelDelete", async channel => {
let entry = await channel.guild.fetchAuditLogs({ type: 'CHANNEL_DELETE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
channel.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
channel.guild.members.ban(entry.executor.id, { reason: `Shera kanal Silme Koruma` });
await channel.clone({ reason: "Kanal Korum Sistemi!" }).then(async kanal => {
if (channel.parentID != null) await kanal.setParent(channel.parentID);
await kanal.setPosition(channel.position);
if (channel.type == "category") await channel.guild.channels.cache.filter(k => k.parentID == channel.id).forEach(x => x.setParent(kanal.id));
});
let channel2 = client.channels.cache.get(ayarlar.log1)
if (!channel2) return console.log('Kanal Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**İzinsiz Kanal Oluşturuldu!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Kanal Bilgisi**
**${channel.name}** **||** **${channel.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel2.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucuda kanal silindi! Silen kişinin bilgileri :** \n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\`\n**Kanal Adı :**\`\`${channel.name}\`\` **Kanal İdsi :** \`\`${channel.id}\`\``)
});
client.on("channelCreate", async channel => {
let entry = await channel.guild.fetchAuditLogs({ type: 'CHANNEL_CREATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
channel.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
channel.guild.members.ban(entry.executor.id, { reason: `Kanal oluşturma Koruma` });
channel.delete({ reason: "Kanal Koruma Sistemi!" });
let channel2 = client.channels.cache.get(ayarlar.log1)
if (!channel2) return console.log('Kanal Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**İzinsiz Kanal Oluşturuldu!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel2.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucuda kanal oluşturuldu! oluşturan kişinin bilgileri :** \n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\``)
});
client.on("channelUpdate", async (oldChannel, newChannel) => {
let entry = await newChannel.guild.fetchAuditLogs({ type: 'CHANNEL_UPDATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000 || !newChannel.guild.channels.cache.has(newChannel.id)) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
if (newChannel.type !== "category" && newChannel.parentID !== oldChannel.parentID) newChannel.setParent(oldChannel.parentID);
if (newChannel.type === "category") {
newChannel.edit({ name: oldChannel.name, });
} else if (newChannel.type === "text") {
newChannel.edit({ name: oldChannel.name, topic: oldChannel.topic, nsfw: oldChannel.nsfw, rateLimitPerUser: oldChannel.rateLimitPerUser });
} else if (newChannel.type === "voice") { newChannel.edit({ name: oldChannel.name, bitrate: oldChannel.bitrate, userLimit: oldChannel.userLimit, }); };
oldChannel.permissionOverwrites.forEach(perm => {
let thisPermOverwrites = {}; perm.allow.toArray().forEach(p => { thisPermOverwrites[p] = true; }); perm.deny.toArray().forEach(p => { thisPermOverwrites[p] = false; });
newChannel.createOverwrite(perm.id, thisPermOverwrites);
});
newChannel.cache.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
newChannel.members.ban(entry.executor.id, { reason: `Shera Kanal Güncelleme koruma` });
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Kanal Günceleme Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**İzinsiz Kanal Güncellendi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Kanal Bilgisi**
**${oldChannel.name}** **||** **${oldChannel.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucuda kanal güncellendi! Güncelliyen kişinin bilgileri :** \n**Kullanıcı Adı :** \`\`${entry.executor.tag}\` **Kullanıcı idsi :** \`${entry.executor.id}\`\`\n**Kanal İdsi :** \`\`${oldChannel.name}\`\` **Kanal İdsi :** \`\`${oldChannel.id}\`\``)
});
client.on("webhookUpdate", async (channel) => {
const entry = await channel.guild.fetchAuditLogs({ type: 'WEBHOOK_CREATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
const webhooks = await channel.fetchWebhooks();
await webhooks.map(x => x.delete({ reason: "s2ş sebebiyle weebhooklar silindi!" }))
channel.guild.members.ban(entry.executor.id, { reason: "Shera Weebhook Koruma" }).catch(err => { });
channel.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
channel.guild.channels.cache.get(ayarlar.log1).send(`${entry.executor} tarafından sunucuda izinsiz webhook açıldı, webhook silinip ve banlandı!`)
client.users.cache.get(ayarlar.sahip).send(`**${entry.executor} tarafından sunucuda izinsiz webhook açıldı, webhook silinip ve banlandı!`)
return;
});
client.on("emojiDelete", async (emoji, message) => {
const entry = await emoji.guild.fetchAuditLogs({ type: "EMOJI_DELETE" }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
emoji.guild.emojis.create(`${emoji.url}`, `${emoji.name}`).catch(console.error);
const uyecik = emoji.guild.members.cache.get(entry.executor.id);
uyecik.roles.set([ayarlar.karantinarol]).catch(err => { })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Emoji Silme Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**İzinsiz Emoji Silindi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Emoji Bilgisi**
**${emoji.name}** **||** **${emoji.id}**
**Emoji yeniden yüklendi yetkili jaile atıldı!**`)
channel.send({ embed: jahky })
});
client.on("emojiCreate", async (emoji, message) => {
const entry = await emoji.guild.fetchAuditLogs({ type: "EMOJI_CREATE" }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
emoji.delete({ reason: "Emoji Koruma Sistemi!" });
const uyecik = emoji.guild.members.cache.get(entry.executor.id);
uyecik.roles.set([ayarlar.karantinarol]).catch(err => { })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Emoji Yükleme Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**İzinsiz Emoji Yüklendi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Emoji silindi ve yetkili jaile atıldı!**`)
channel.send({ embed: jahky })
});
client.on("emojiUpdate", async (oldEmoji, newEmoji) => {
if (oldEmoji === newEmoji) return;
const entry = await oldEmoji.guild.fetchAuditLogs({ type: "EMOJI_UPDATE" }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
await newEmoji.setName(oldEmoji.name);
const uyecik = oldEmoji.guild.members.cache.get(entry.executor.id);
uyecik.roles.set([ayarlar.karantinarol]).catch(err => { })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Emoji Güncelleme Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**İzinsiz Emoji Güncellendi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Emoji Bilgisi**
**${oldEmoji.name}** **||** **${oldEmoji.id}**
**Emoji eski haline getirildi ve yetkili jaile atıldı!**`)
channel.send({ embed: jahky })
});
client.on("guildMemberAdd", async member => {
const entry = await member.guild
.fetchAuditLogs({ type: "BOT_ADD" })
.then(audit => audit.entries.first());
const xd = entry.executor;
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe.bots.includes(entry.executor.id)) return;
if (matthe.owners.includes(entry.executor.id)) return;
if (matthe.guvenlid.includes(entry.executor.id)) return;
if (member.user.bot) {
member.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
member.guild.members.ban(entry.executor.id, { reason: "Shera Bot Koruma" })
member.guild.members.ban(member.id, { reason: "Bot Koruma Sistemi!" })
let channel = client.channels.cache.get(ayarlar.log1)
if (!channel) return console.log('Bot Koruma Logu Yok!');
const jahky = new Discord.MessageEmbed()
.setTimestamp()
.setColor(ayarlar.color)
.setFooter(ayarlar.footer)
.setDescription(`
**Sunucuya İzinsiz Bot Eklendi!**
**Yetkili Bilgisi**
**${xd.tag}** **||** **${xd.id}**
**Botun Bilgisi**
**${member.user.tag}** **||** **${member.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client.users.cache.get(ayarlar.sahip).send(`**Sunucuya Bir Bot Eklendi! Eklenen Botun Bilgileri Ve Ekliyen Kişinin Bilgileri :** \n**Botun Adı :** \`\`${member.user.tag}\`\` **Botun İdsi :** \`\`${member.id}\`\` \n**Kullanıcı Adı :** \`\`${xd.tag}\`\` **Kullanıcı İdsi :** \`\`${xd.id}\`\``)
}
});
//-------------------------------------------------------------\\
const Discord1 = require("discord.js");
const ayarlar1 = require('./ayarlar.json')
const matthe1 = require('./ayar.json')
const client1 = new Discord1.Client();
let express1 = require('express');
client1.on("guildBanAdd", async function (guild, user) {
const entry = await guild
.fetchAuditLogs({ type: "MEMBER_BAN_ADD" })
.then(audit => audit.entries.first());
const yetkili = await guild.members.cache.get(entry.executor.id);
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe1.bots.includes(entry.executor.id)) return;
if (matthe1.owners.includes(entry.executor.id)) return;
if (matthe1.guvenlid.includes(entry.executor.id)) return;
guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
guild.members.ban(entry.executor.id, { reason: "Shera Ban Koruma" })
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('Ban Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**Sunucudan Bir Kullanıcı İzinsiz Yasaklandı!**
**Yetkili Bilgisi**
**${yetkili.user.tag}** **||** **${yetkili.id}**
**Kullanıcı Bilgisi**
**${user.tag}** **||** **${user.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client1.users.cache.get(ayarlar1.sahip).send(`**Sunucudan Bir Kullanıcı İzinsiz Yasaklandı!** \n**Yasaklıyan Ve Yasaklanan Kişilerin Bilgileri** \n**Yetkilinin Adı :** \`\`${yetkili.user.tag}\`\` **Yetkilinin İdsi :** \`\`${yetkili.id}\`\`\n**Kullanıcın Adı :** \`\`${user.tag}\`\` **Kullanıcının İdsi :** \`\`${user.id}\`\``)
});
client1.on("guildMemberRemove", async kickhammer => {
const guild = kickhammer.guild;
const entry = await guild
.fetchAuditLogs()
.then(audit => audit.entries.first());
if (entry.action == `MEMBER_KICK`) {
let yetkili = await guild.members.cache.get(entry.executor.id);
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe1.bots.includes(entry.executor.id)) return;
if (matthe1.owners.includes(entry.executor.id)) return;
if (matthe1.guvenlid.includes(entry.executor.id)) return;
kickhammer.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
kickhammer.guild.members.ban(yetkili.id, { reason: "Shera kick koruma" })
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('Kick Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**Sunucudan Bir Kullanıcı İzinsiz Kicklendi!**
**Yetkili Bilgisi**
**${yetkili.user.tag}** **||** **${yetkili.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client1.users.cache.get(ayarlar1.sahip).send(`**Sunucudan Bir Kullanıcı İzinsiz Kicklendi!** \n**Kickleyen Kişinin Bilgileri** \n**Yetkilinin Adı :** \`\`${yetkili.user.tag}\`\` **Yetkilinin İdsi :** \`\`${yetkili.id}\`\``)
}
});
client1.on("guildMemberAdd", async member => {
const entry = await member.guild
.fetchAuditLogs({ type: "BOT_ADD" })
.then(audit => audit.entries.first());
const xd = entry.executor;
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe1.bots.includes(entry.executor.id)) return;
if (matthe1.owners.includes(entry.executor.id)) return;
if (matthe1.guvenlid.includes(entry.executor.id)) return;
if (member.user.bot) {
member.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
member.guild.members.ban(entry.executor.id, { reason: "Shera Bot Koruma" })
member.guild.members.ban(member.id, { reason: "Bot Koruma Sistemi!" })
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('Bot Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**Sunucuya İzinsiz Bot Eklendi!**
**Yetkili Bilgisi**
**${xd.tag}** **||** **${xd.id}**
**Botun Bilgisi**
**${member.user.tag}** **||** **${member.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client1.users.cache.get(ayarlar1.sahip).send(`**Sunucuya Bir Bot Eklendi! Eklenen Botun Bilgileri Ve Ekliyen Kişinin Bilgileri :** \n**Botun Adı :** \`\`${member.user.tag}\`\` **Botun İdsi :** \`\`${member.id}\`\` \n**Kullanıcı Adı :** \`\`${xd.tag}\`\` **Kullanıcı İdsi :** \`\`${xd.id}\`\``)
}
});
client1.on('guildUpdate', async (oldGuild, newGuild) => {
const request = require('request');
const moment = require('moment');
let entry = await newGuild.fetchAuditLogs({ type: 'GUILD_UPDATE' }).then(audit => audit.entries.first());
if (!entry.executor || entry.executor.id === client1.user.id || Date.now() - entry.createdTimestamp > 10000) return;
moment.locale('tr');
if (newGuild.vanityURLCode === null) return; // URL yoksa bişi yapmasın.
if (oldGuild.vanityURLCode === newGuild.vanityURLCode) return; // URL'ler aynıysa bişi yapmasın.
if (matthe1.bots.includes(entry.executor.id)) return;
if (matthe1.owners.includes(entry.executor.id)) return;
if (matthe1.guvenlid.includes(entry.executor.id)) return;
newGuild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
newGuild.members.ban(entry.executor.id, { reason: "URL Koruma Sistemi!" })
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('URL Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**Sunucu ayarlar1ıyla Oynandı!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
client1.users.cache.get(ayarlar1.sahip).send(`**Sunucu URL'si değiştirildi! Değiştiren kişinin bilgileri :**\n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdisi :** \`\`${entry.executor.id}\`\``)
request({
method: 'PATCH',
url: `https://Discord1.com/api/v8/guilds/${newGuild.id}/vanity-url`,
body: {
code: ayarlar1.url
},
json: true,
headers: {
"Authorization": `Bot ${ayarlar1.token2}`
}
}, (err, res, body) => {
if (err) {
return console.log(err);
}
});
});
client1.on("guildUpdate", async (oldGuild, newGuild) => {
let entry = await newGuild.fetchAuditLogs({ type: 'GUILD_UPDATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe1.bots.includes(entry.executor.id)) return;
if (matthe1.owners.includes(entry.executor.id)) return;
if (matthe1.guvenlid.includes(entry.executor.id)) return;
if (newGuild.name !== oldGuild.name) newGuild.setName(oldGuild.name);
newGuild.setIcon(oldGuild.iconURL({ dynamic: true, size: 2048 }));
newGuild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
newGuild.members.ban(entry.executor.id, { reason: `Sunucuyu izinsiz güncellemek.` });
const moment = require('moment');
moment.locale('tr');
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('Sunucu Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**Sunucu ayarlar1ıyla Oynandı!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client1.users.cache.get(ayarlar1.sahip).send(`**Sunucu ayarlar1ıyla Oynandı! Oynıyan Kişinin Bilgileri :**\n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\``)
});
client1.on("roleDelete", async role => {
let entry = await role.guild.fetchAuditLogs({ type: 'ROLE_DELETE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe1.bots.includes(entry.executor.id)) return;
if (matthe1.owners.includes(entry.executor.id)) return;
if (matthe1.guvenlid.includes(entry.executor.id)) return;
role.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
role.guild.members.ban(entry.executor.id, { reason: `İzinsiz rol silme!` });
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('Rol Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**Sunucuda Rol Silindi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Rol Bilgisi**
**${role.name}** **||** **${role.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client1.users.cache.get(ayarlar1.sahip).send(`**Sunucuda rol silindi! silen kişinin bilgileri :** \n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\`\n**Rol Adı :** \`\`${role.name}\`\` **Rol İdsi :** \`\`${role.id}\`\``)
});
client1.on("roleCreate", async role => {
let entry = await role.guild.fetchAuditLogs({ type: 'ROLE_CREATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe1.bots.includes(entry.executor.id)) return;
if (matthe1.owners.includes(entry.executor.id)) return;
if (matthe1.guvenlid.includes(entry.executor.id)) return;
role.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
role.guild.members.ban(entry.executor.id, { reason: `İzinsiz rol oluşturma!` });
role.delete({ reason: "Rol Koruma Sistemi" });
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('Rol Açma Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**Sunucuda Rol Açıldı!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client1.users.cache.get(ayarlar1.sahip).send(`**Sunucuda rol açıldı! açan kişinin bilgileri :** \n**Kullanıcı Adıı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\``)
});
client1.on("roleUpdate", async (oldRole, newRole) => {
let entry = await newRole.guild.fetchAuditLogs({ type: 'ROLE_UPDATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe1.bots.includes(entry.executor.id)) return;
if (matthe1.owners.includes(entry.executor.id)) return;
if (matthe1.guvenlid.includes(entry.executor.id)) return;
if (yetkiPermleri.some(p => !oldRole.permissions.has(p) && newRole.permissions.has(p))) {
newRole.setPermissions(oldRole.permissions);
newRole.guild.roles.cache.filter(r => !r.managed && (r.permissions.has("ADMINISTRATOR") || r.permissions.has("MANAGE_ROLES") || r.permissions.has("MANAGE_GUILD"))).forEach(r => r.setPermissions(36818497));
};
newRole.edit({
name: oldRole.name,
color: oldRole.hexColor,
hoist: oldRole.hoist,
permissions: oldRole.permissions,
mentionable: oldRole.mentionable
});
newRole.guild.roles.cache.forEach(async function (jahky) {
if (jahky.permissions.has("ADMINISTRATOR") || jahky.permissions.has("BAN_MEMBERS") || jahky.permissions.has("MANAGE_GUILD") || jahky.permissions.has("KICK_MEMBERS") || jahky.permissions.has("MANAGE_ROLES") || jahky.permissions.has("MANAGE_CHANNELS")) {
jahky.setPermissions(0).catch(err => { });
}
});
newRole.guild.members.ban(entry.executor.id, { reason: `İzinsiz Rol Güncelleme!` });
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('Rol Günceleme Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**Sunucuda Rol Güncellendi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Rol Bilgisi**
**${oldRole.name}** **||** **${oldRole.id}**
**Yetkili sunucudan yasaklandı! Rollerdeki tüm yetkiler kapatıldı.**`)
channel.send({ embed: jahky })
return client1.users.cache.get(ayarlar1.sahip).send(`**Sunucuda rol güncellendi! Günceliyen kişinin bilgileri :** \n**Kullanıcı Adı :** \`\`${entry.executor.tag}\`\` **Kullanıcı İdsi :** \`\`${entry.executor.id}\`\`\n**Rol Adı :**\`\`${oldRole.name}\`\` **Rol İdsi :** \`\`${oldRole.id}\`\``)
});
const yetkiPermleri1 = ["ADMINISTRATOR", "MANAGE_ROLES", "MANAGE_CHANNELS", "MANAGE_GUILD", "BAN_MEMBERS", "KICK_MEMBERS", "MANAGE_NICKNAMES", "MANAGE_EMOJIS", "MANAGE_WEBHOOKS"];
client1.on("guildMemberUpdate", async (oldMember, newMember) => {
if (newMember.roles.cache.size > oldMember.roles.cache.size) {
let entry = await newMember.guild.fetchAuditLogs({ type: 'MEMBER_ROLE_UPDATE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe1.bots.includes(entry.executor.id)) return;
if (matthe1.owners.includes(entry.executor.id)) return;
if (matthe1.guvenlid.includes(entry.executor.id)) return;
const uyecik = newMember.guild.members.cache.get(entry.executor.id);
if (yetkiPermleri1.some(p => !oldMember.hasPermission(p) && newMember.hasPermission(p))) {
newMember.roles.set(oldMember.roles.cache.map(r => r.id));
uyecik.roles.set([ayarlar1.karantinarol]).catch(err => { })
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('Rol Verme Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**İzinsiz Yönetici Rolü Verildi!**
**Yetkili Bilgisi**
**${entry.executor.tag}** **||** **${entry.executor.id}**
**Kullanıcı Bilgisi**
**${newMember.user.tag}** **||** **${newMember.id}**
**Yetkilinin yetkileri alınıp karantinaya atıldı!**`)
channel.send({ embed: jahky })
};
};
});
client1.on("guildMemberUpdate", async (oldMember, newMember) => {
let guild = newMember.guild;
if (oldMember.nickname != newMember.nickname) {
let logs = await guild.fetchAuditLogs({ limit: 5, type: "MEMBER_UPDATE" }).then(e => e.entries.sort((x, y) => y.createdTimestamp - x.createdTimestamp));
let log = logs.find(e => ((Date.now() - e.createdTimestamp) / (1000)) < 5);
if (!log) return;
if (oldMember.user.id === log.executor.id) return
if (matthe1.bots.includes(log.executor.id)) return;
if (matthe1.owners.includes(log.executor.id)) return;
if (matthe1.guvenlid.includes(log.executor.id)) return;
const uyecik = newMember.guild.members.cache.get(log.executor.id);
uyecik.roles.set([ayarlar1.karantinarol]).catch(err => { })
let channel = client1.channels.cache.get(ayarlar1.log1)
if (!channel) return console.log('İsim Koruma Logu Yok!');
const jahky = new Discord1.MessageEmbed()
.setTimestamp()
.setColor(ayarlar1.color)
.setFooter(ayarlar1.footer)
.setDescription(`
**İzinsiz İsim Güncellendi!**
**Yetkili Bilgisi**
**${log.executor.tag}** **||** **${log.executor.id}**
**Kullanıcı Bilgisi**
**${newMember.user.tag}** **||** **${newMember.id}**
**İsim Bilgisi**
**${oldMember.nickname}** **>** **${newMember.nickname}**
**Yetkilinin yetkileri alınıp karantinaya atıldı!**`)
channel.send({ embed: jahky })
return;
}
});
client1.on("channelDelete", async channel => {
let entry = await channel.guild.fetchAuditLogs({ type: 'CHANNEL_DELETE' }).then(audit => audit.entries.first());
if (!entry || !entry.executor || Date.now() - entry.createdTimestamp > 10000) return;
if (matthe1.bots.includes(entry.executor.id)) return;