├── LICENSE ├── Procfile ├── Readme.md ├── Satuke.js ├── Settings.json ├── TheSatuke ├── Async.js ├── Data.js ├── Guard.js └── Models │ ├── Database │ └── RoleGuard.js │ ├── Guard.json │ ├── Güvenliler.json │ ├── RoleBackup.js │ └── Web.js └── package.json /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 SatukeJS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker node Satuke.js 2 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ## Bilgilendirme 2 | 3 | - Soru ve bot hakkında sorunlar için: `satuke champion,#1080 (707325480378040430)` 4 | 5 | ```bash 6 | > Biliyorsunuz ortada dönen bir web site koruma sistemi var, bu projede bunun tam hali var iyi kullanımlar 7 | > Selam dostlarım, kendi yaptığım ve 1 hafta önce kullandığım guard altyapımı burda paylaşıcam ve coğu paylasılan altyapıdan sağlam olduğunu düşünüyorum 8 | > Logların olduğu kısıma idler değil kanal isimleri girilecek mesela kanalın adı defender-log burdada böyle ayarlayacaksınız tesekkürler. 9 | > Herhangi bir hata bulmanız durumunda ya da yardım isteyeceğiniz zaman buralardan bana ulaşabilirsiniz. 10 | ``` 11 | 12 | ### NOT: Botta MIT lisansı bulunmaktadır, Bu botun dosyalarının benden habersiz paylaşılması/satılması durumunda gerekli işlemler yapılacaktır! 13 | -------------------------------------------------------------------------------- /Satuke.js: -------------------------------------------------------------------------------- 1 | const { Client } = require("discord.js"); 2 | const client = global.Client = new Client({ fetchAllMembers: true }); 3 | require('discord-reply'); 4 | const Settings = require("./Settings.json"); 5 | 6 | const mongoose = require("mongoose"); 7 | mongoose.connect(Settings.Mongoose.DatabaseUrl.replace("", Settings.Mongoose.DatabaseName), { 8 | useNewUrlParser: true, 9 | useUnifiedTopology: true, 10 | useFindAndModify: false 11 | }); 12 | mongoose.connection.on("connected", () => { console.log(`[Mongoose] MongoDB'ye başarıyla bağlandım.`) 13 | require("./TheSatuke/Async.js"); 14 | require("./TheSatuke/Data.js"); 15 | require("./TheSatuke/Guard.js"); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "Token": 4 | { 5 | "Guard_1":"tokenler falan", 6 | "Guard_2":"tokenler falan", 7 | "Guard_3":"tokenler falan", 8 | "Backup": "tokenler falan", 9 | "Async":"tokenler falan" 10 | }, 11 | 12 | "Roles": { 13 | "JailRoles":"jail rolü", 14 | "BoosterRole":"booster rolü" 15 | }, 16 | 17 | "Server": { 18 | "GuildID":"sunucu idsi", 19 | "OwnerID":"kendi idniz", 20 | "VoiceChannel":"Botların sese bağlanacağı kanal", 21 | "VanityURL":"Sunucunun Özel Urlsi", 22 | "Status":"MyServer ❤️ Satukê.", 23 | "EmbedColor":"#6fddab" 24 | }, 25 | 26 | "Prefix": { 27 | "Guard_1P":"g!", 28 | "BackupPrefix":"b!", 29 | "Guard_2P":"+", 30 | "Guard_3P":"-" 31 | }, 32 | 33 | "Mongoose": { 34 | "DatabaseUrl":"Mongoose Connect", 35 | "DatabaseName":"Database Name" 36 | }, 37 | 38 | "Log": { 39 | "Guard_Log1": "guard-log", 40 | "Guard_Log2": "guard-log", 41 | "Guard_Log3": "guard-log", 42 | "WebLog": "web-log", 43 | "databaseLog": "database-log", 44 | "Async_Log": "guard-log" 45 | } 46 | 47 | 48 | } -------------------------------------------------------------------------------- /TheSatuke/Async.js: -------------------------------------------------------------------------------- 1 | const { Client } = require('discord.js'); 2 | const Async = new Client(); 3 | const Settings = require("../Settings.json"); 4 | const request = require('request'); 5 | 6 | Async.on("ready", async () => { 7 | Async.user.setPresence({ 8 | activity: { 9 | name: Settings.Server.Status }, 10 | status: "dnd", 11 | type: "PLAYING" 12 | }); 13 | let botVoiceChannel = Async.channels.cache.get(Settings.Server.VoiceChannel); 14 | if (botVoiceChannel) botVoiceChannel.join().catch(err => console.error("[ASYNC] Sese Bağlanamadı!"))}); 15 | 16 | Async.on('guildUpdate', async (oldGuild, newGuild) => { 17 | if (oldGuild.vanityURLCode === newGuild.vanityURLCode) return; 18 | let entry = await newGuild.fetchAuditLogs({ type: 'GUILD_UPDATE' }).then(audit => audit.entries.first()); 19 | if (!entry.executor || entry.executor.id === Async.user.id) return; 20 | let channel = Async.channels.cache.find(x => x.name == Settings.Log.Async_Log) 21 | if (channel) channel.send(`🔐 ${entry.executor} (\`${entry.executor.id}\`) Sunucunun **${Settings.Server.VanityURL} adlı urlyi değiştirmeye çalıştı!, @everyone`) 22 | if (!channel) newGuild.owner.send(`🔐 ${entry.executor} ${entry.executor.id} Sunucunun **${Settings.Server.VanityURL} adlı urlyi değiştirmeye çalıştı! (Log Kanalını Bulamadığım İçin sana attım!)`) 23 | newGuild.members.ban(entry.executor.id, { reason: `URL Değiştirme | (Vanity Url Guard).`}); 24 | 25 | const bisiylerdeniyom = { 26 | url: `https://discord.com/api/v6/guilds/${newGuild.id}/vanity-url`, 27 | body: { 28 | code: Settings.Server.VanityURL }, 29 | json: true, 30 | method: 'PATCH', 31 | headers: { "Authorization": `Bot ${Settings.Token.Async}` } 32 | }; 33 | 34 | request(bisiylerdeniyom, (err, res, body) => { 35 | if (err) { 36 | return console.log(err); 37 | } 38 | }); 39 | }); 40 | 41 | 42 | 43 | Async.on('warn', m => console.log(`[WARN]:${m}`)); 44 | Async.on('error', m => console.log(`[ERROR]: ${m}`)); 45 | Async.on("disconnect", () => console.log("Bot bağlantısı kesildi")) 46 | Async.on("reconnecting", () => console.log("Bot tekrar bağlanıyor...")) 47 | process.on('uncaughtException', error => console.log(`[ERROR]: ${error}`)); 48 | process.on('unhandledRejection', err => console.log(`[ERROR]: ${err}`)); 49 | 50 | Async.login(Settings.Token.Async).then(x => console.log(`[ASYNC] - Olarak Başarıyla Giriş Yapıldı!`)).catch(err => console.error(`[ERROR] Hata : ${err}`)) 51 | -------------------------------------------------------------------------------- /TheSatuke/Data.js: -------------------------------------------------------------------------------- 1 | const { Discord, Client, MessageEmbed } = require('discord.js'); 2 | const client = global.client = new Client({fetchAllMembers: true}); 3 | const Settings = require("../Settings.json"); 4 | const fs = require('fs'); 5 | const mongoose = require('mongoose'); 6 | mongoose.connect(Settings.Mongoose.DatabaseUrl, {useNewUrlParser: true, useUnifiedTopology: true}); 7 | const Database = require("./Models/RoleBackup"); 8 | client.on("ready", async () => { 9 | client.user.setPresence({ activity: { name: Settings.Server.Status }, status: "dnd" }); 10 | let botVoiceChannel = client.channels.cache.get(Settings.Server.VoiceChannel); 11 | if (botVoiceChannel) botVoiceChannel.join().catch(err => console.error("Ses Kanalına Bağlanamadım")); 12 | }); 13 | 14 | // ************************************************************************************************************************************* // 15 | 16 | setRoleBackup(); 17 | setInterval(() => { 18 | setRoleBackup(); 19 | }, 1000*60*60*1);; 20 | 21 | // ************************************************************************************************************************************* // 22 | 23 | client.on("message", async message => { 24 | if (message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(Settings.Prefix.BackupPrefix)) return; 25 | if (message.author.id !== Settings.Server.OwnerID && message.author.id !== message.guild.owner.id) return; 26 | let args = message.content.split(' ').slice(1); 27 | let command = message.content.split(' ')[0].slice(Settings.Prefix.BackupPrefix.length); 28 | let embed = new MessageEmbed().setColor("BLUE").setAuthor(message.member.displayName, message.author.avatarURL({ dynamic: true, })).setTimestamp(); 29 | 30 | if (command === "eval" && message.author.id === Settings.Server.OwnerID) { 31 | if (!args[0]) return message.channel.send(`Kodu belirt.`); 32 | let code = args.join(' '); 33 | function clean(text) { 34 | if (typeof text !== 'string') text = require('util').inspect(text, { depth: 0 }) 35 | text = text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203)) 36 | return text; 37 | }; 38 | try { 39 | var evaled = clean(await eval(code)); 40 | if(evaled.match(new RegExp(`${client.token}`, 'g'))) evaled.replace(client.token, "Yasaklı komut"); 41 | message.channel.send(`${evaled.replace(client.token, "Yasaklı komut")}`, {code: "js", split: true}); 42 | } catch(err) { message.channel.send(err, {code: "js", split: true}) }; 43 | }; 44 | 45 | if(command === "restart") { 46 | message.channel.send("Bot yeniden başlatılıyor").then(msg => { 47 | console.log("[BOT] Yeniden başlatılıyor"); 48 | process.exit(0); 49 | }); 50 | 51 | }; 52 | 53 | 54 | // ************************************************************************************************************************************* // 55 | 56 | if(command === "kur" || command === "kurulum" || command === "backup" || command === "setup") { 57 | if (!args[0] || isNaN(args[0])) return message.channel.send(embed.setDescription("Geçerli bir \`Rol ID\` belirtmelisin.")); 58 | 59 | Database.findOne({guildID: Settings.Server.GuildID, roleID: args[0]}, async (err, roleData) => { 60 | if (!roleData) return message.channel.send(embed.setDescription("Belirttiğin \`Rol ID'sine\` ait veri bulamadım.")); 61 | let yeniRol = await message.guild.roles.create({ 62 | data: { 63 | name: roleData.name, 64 | color: roleData.color, 65 | hoist: roleData.hoist, 66 | permissions: roleData.permissions, 67 | position: roleData.position, 68 | mentionable: roleData.mentionable 69 | }, 70 | reason: "Rol silindiği için tekrar oluşturuldu." 71 | }); 72 | 73 | setTimeout(() => { 74 | let kanalPermVeri = roleData.channelOverwrites; 75 | if (kanalPermVeri) kanalPermVeri.forEach((perm, index) => { 76 | let kanal = message.guild.channels.cache.get(perm.id); 77 | if (!kanal) return; 78 | setTimeout(() => { 79 | let yeniKanalPermVeri = {}; 80 | perm.allow.forEach(p => { 81 | yeniKanalPermVeri[p] = true; 82 | }); 83 | perm.deny.forEach(p => { 84 | yeniKanalPermVeri[p] = false; 85 | }); 86 | kanal.createOverwrite(yeniRol, yeniKanalPermVeri).catch(console.error); 87 | }, index*5000); 88 | }); 89 | }, 5000); 90 | 91 | let roleMembers = roleData.members; 92 | roleMembers.forEach((member, index) => { 93 | let uye = message.guild.members.cache.get(member); 94 | if (!uye || uye.roles.cache.has(yeniRol.id)) return; 95 | setTimeout(() => { 96 | uye.roles.add(yeniRol.id).catch(console.error); 97 | }, index*3000); 98 | }); 99 | 100 | let logKanali = client.channels.cache.find(a => a.name == Settings.Log.databaseLog) 101 | if (logKanali) { logKanali.send(`🛡️ ${message.author} tarafından (\`${roleData.name}\`), (\`${roleData.roleID}\`) Rolün yedeği kurulmaya başladı, üyelere dağıtılmaya, kanalların izinlerine eklenmeye başlanıyor, @here`).catch(); } 102 | else { message.guild.owner.send(`🛡️ ${message.author} tarafından (\`${roleData.name}\`), (\`${roleData.roleID}\`) Rolün yedeği kurulmaya başladı, üyelere dağıtılmaya, kanalların izinlerine eklenmeye başlanıyor, @here`).catch(err => {}); }; 103 | }); 104 | }; 105 | }); 106 | 107 | function setRoleBackup() { 108 | let guild = client.guilds.cache.get(Settings.Server.GuildID); 109 | let DatabaseLog = client.channels.cache.find(a => a.name == Settings.Log.databaseLog) 110 | if (guild) { 111 | guild.roles.cache.filter(r => r.name !== "@everyone" && !r.managed).forEach(role => { 112 | let roleChannelOverwrites = []; 113 | guild.channels.cache.filter(c => c.permissionOverwrites.has(role.id)).forEach(c => { 114 | let channelPerm = c.permissionOverwrites.get(role.id); 115 | let pushlanacak = { id: c.id, allow: channelPerm.allow.toArray(), deny: channelPerm.deny.toArray() }; 116 | roleChannelOverwrites.push(pushlanacak); 117 | }); 118 | 119 | Database.findOne({guildID: Settings.Server.GuildID, roleID: role.id}, async (err, savedRole) => { 120 | if (!savedRole) { 121 | let newRoleSchema = new Database({ 122 | _id: new mongoose.Types.ObjectId(), 123 | guildID: Settings.Server.GuildID, 124 | roleID: role.id, 125 | name: role.name, 126 | color: role.hexColor, 127 | hoist: role.hoist, 128 | position: role.position, 129 | permissions: role.permissions, 130 | mentionable: role.mentionable, 131 | time: Date.now(), 132 | members: role.members.map(m => m.id), 133 | channelOverwrites: roleChannelOverwrites 134 | }); 135 | newRoleSchema.save(); 136 | } else { 137 | savedRole.name = role.name; 138 | savedRole.color = role.hexColor; 139 | savedRole.hoist = role.hoist; 140 | savedRole.position = role.position; 141 | savedRole.permissions = role.permissions; 142 | savedRole.mentionable = role.mentionable; 143 | savedRole.time = Date.now(); 144 | savedRole.members = role.members.map(m => m.id); 145 | savedRole.channelOverwrites = roleChannelOverwrites; 146 | savedRole.save(); 147 | }; 148 | }); 149 | }); 150 | 151 | Database.find({guildID: Settings.Server.GuildID}).sort().exec((err, roles) => { 152 | roles.filter(r => !guild.roles.cache.has(r.roleID) && Date.now()-r.time > 1000*60*60*24*3).forEach(r => { 153 | Database.findOneAndDelete({roleID: r.roleID}); 154 | 155 | 156 | }); 157 | }); 158 | console.log(`Rollerin Yedeğini MongoDB'Ye kaydetttim.`); 159 | DatabaseLog.send(`📕 Sunucunun Rollerinin Yedeği Başarıyla Alındı!`) 160 | }; 161 | 162 | } 163 | 164 | 165 | const userRoles = require("../TheSatuke/Models/Web"); 166 | let g = Settings.Server.OwnerID; 167 | let s = Settings.Server.GuildID; 168 | client.on("presenceUpdate", async (eski, yeni) => { 169 | const stat = Object.keys(yeni.user.presence.clientStatus); 170 | const embed = new MessageEmbed(); 171 | const channel = client.channels.cache.find((e) => e.name === Settings.Log.WebLog); 172 | const roller = yeni.member.roles.cache.filter((e) => e.editable && e.name !== "@everyone" && [8, 4, 2, 16, 32, 268435456, 536870912].some((s) => e.permissions.has(s))); 173 | if (!yeni.user.bot && yeni.guild.id === s && [8, 4, 2, 16, 32, 268435456, 536870912].some((e) => yeni.member.permissions.has(e)) ) { 174 | const sunucu = client.guilds.cache.get(s); 175 | if (g === yeni.user.id) return; 176 | if (stat.find(e => e === "web")) { 177 | await userRoles.findOneAndUpdate({ guildID: s, userID: yeni.user.id }, { $set: { roles: roller.map((e) => e.id) } }, { upsert: true }); 178 | await yeni.member.roles.remove(roller.map((e) => e.id), "Sekme Açma Şüphesi Yüzünden Yetkileri Alındı."); 179 | if (channel) channel.send(`@everyone`) 180 | channel.send(embed.setDescription(`${yeni.user.toString()} Sekme Açma Şüphesiyle Yetkileri Alındı \n\n**Rollerin Listesi:** \n${roller.map((e) => `<@&${e.id}>`).join("\n")}`).setAuthor(yeni.member.displayName, yeni.user.avatarURL({ dynamic: true })).setColor(Settings.Server.EmbedColor )); 181 | } 182 | } 183 | if (!stat.find(e => e === "web")) { 184 | const db = await userRoles.findOne({ guildID: s, userID: yeni.user.id }); 185 | if (!db) return; 186 | if (db.roles || db.roles.length) { 187 | await db.roles.map(e => yeni.member.roles.add(e, "Sekme Kapatma İşleni Yaptığı İçin Rolleri Geri Verildi.").then(async () => { 188 | await userRoles.findOneAndDelete({ guildID: s, userID: yeni.user.id }); 189 | if (channel) channel.send(embed.setDescription(`${yeni.user.toString()} Sekme islemini geri aldı! \n\n**Rollerin Listesi:** \n${db.roles.map((e) => `<@&${e}>`).join("\n")}`).setAuthor(yeni.member.displayName, yeni.user.avatarURL({ dynamic: true })).setColor(Settings.Server.EmbedColor));}).catch(() => {})); 190 | } 191 | } 192 | }); 193 | 194 | 195 | client.on('warn', m => console.log(`[WARN]:${m}`)); 196 | client.on('error', m => console.log(`[ERROR]: ${m}`)); 197 | client.on("disconnect", () => console.log("Bot bağlantısı kesildi")) 198 | client.on("reconnecting", () => console.log("Bot tekrar bağlanıyor...")) 199 | process.on('uncaughtException', error => console.log(`[ERROR]: ${error}`)); 200 | process.on('unhandledRejection', err => console.log(`[ERROR]: ${err}`)); 201 | client.login(Settings.Token.Backup).then(x => console.log(`[DATABASE] - Olarak Başarıyla Giriş Yapıldı!`)).catch(err => console.error(`[ERROR] Hata : ${err}`)) 202 | -------------------------------------------------------------------------------- /TheSatuke/Guard.js: -------------------------------------------------------------------------------- 1 | 2 | const { Discord, Client, MessageEmbed } = require('discord.js'); 3 | const client = global.client = new Client({ fetchAllMembers: true }); 4 | const fs = require('fs'); 5 | const request = require('request'); 6 | 7 | const Database = require("./Models/Database/RoleGuard"); 8 | const Settings = require("../Settings.json"); 9 | 10 | const Client1 = require("discord.js"); 11 | const Client2 = require("discord.js"); 12 | const Client3 = require("discord.js"); 13 | 14 | const PermArray = [ 15 | "ADMINISTRATOR", 16 | "MANAGE_ROLES", 17 | "MANAGE_CHANNELS", 18 | "MANAGE_GUILD", 19 | "BAN_MEMBERS", 20 | "KICK_MEMBERS", 21 | "MANAGE_NICKNAMES", 22 | "MANAGE_EMOJIS", 23 | "MANAGE_WEBHOOKS" 24 | ]; 25 | 26 | const Guard_1 = new Client1.Client(); 27 | const Guard_2 = new Client2.Client(); 28 | const Guard_3 = new Client3.Client(); 29 | 30 | const korumalar = require("./Models/Guard.json") 31 | 32 | const Güvenliler = require("./Models/Güvenliler.json"); 33 | 34 | const mongoose = require('mongoose'); 35 | mongoose.connect(Settings.Mongoose.DatabaseUrl, {useNewUrlParser: true, useUnifiedTopology: true}); 36 | 37 | Guard_1.on("message", async message => { 38 | if (message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(Settings.Prefix.Guard_1P)) return; 39 | if (message.author.id !== Settings.Server.OwnerID && message.author.id !== message.guild.owner.id) return; 40 | let args = message.content.split(' ').slice(1); 41 | let command = message.content.split(' ')[0].slice(Settings.Prefix.Guard_1P.length); 42 | let embed = new MessageEmbed().setColor(Settings.Server.EmbedColor).setAuthor(message.member.displayName, message.author.avatarURL({ dynamic: true, })) 43 | if (command === "eval" && message.author.id === Settings.Server.OwnerID) { 44 | if (!args[0]) return; 45 | let code = args.join(' '); 46 | function clean(text) { 47 | if (typeof text !== 'string') text = require('util').inspect(text, { depth: 0 }) 48 | text = text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203)) 49 | return text; 50 | }; 51 | try { 52 | var evaled = clean(await eval(code)); 53 | if(evaled.match(new RegExp(`${Guard_1.token}`, 'g'))) evaled.replace(Guard_1.token, "Yasaklı komut"); 54 | message.channel.send(`${evaled.replace(Guard_1.token, "Yasaklı komut")}`, {code: "js", split: true}); 55 | } catch(err) { message.channel.send(err, {code: "js", split: true}) }; 56 | }; 57 | 58 | if(command == "liste") { 59 | let hedef; 60 | let rol = message.mentions.roles.first() || message.guild.roles.cache.get(args[0]) || message.guild.roles.cache.find(r => r.name === args.join(" ")); 61 | let uye = message.mentions.users.first() || message.guild.members.cache.get(args[0]); 62 | if (rol) hedef = rol; 63 | if (uye) hedef = uye; 64 | let guvenliler = Güvenliler.whitelist || []; 65 | if (!hedef) return message.channel.send(embed.addField("Güvenli Liste (White List)" ,guvenliler.length > 0 ? guvenliler.map(g => (message.guild.roles.cache.has(g.slice(1)) || message.guild.members.cache.has(g.slice(1))) ? (message.guild.roles.cache.get(g.slice(1)) || message.guild.members.cache.get(g.slice(1))) : g).join('\n ') : "\`\`\`Burası Çok Issız..\`\`\`"));}; 66 | 67 | 68 | if(command === "safe" || "güvenli") { 69 | let hedef; 70 | let rol = message.mentions.roles.first() || message.guild.roles.cache.get(args[0]) || message.guild.roles.cache.find(r => r.name === args.join(" ")); 71 | let uye = message.mentions.users.first() || message.guild.members.cache.get(args[0]); 72 | if (rol) hedef = rol; 73 | if (uye) hedef = uye; 74 | let guvenliler = Güvenliler.whitelist || []; 75 | if (!hedef) return message.channel.send(embed 76 | .setDescription(`Güvenli Listeye Eklemek/Kaldırmak İçin \`@Satuke/ID\` Belirtmelisin.`)); 77 | if (guvenliler.some(g => g.includes(hedef.id))) { 78 | guvenliler = guvenliler.filter(g => !g.includes(hedef.id)); 79 | Güvenliler.whitelist = guvenliler; 80 | fs.writeFile("./ayarlar.json", JSON.stringify(Güvenliler), (err) => { 81 | if (err) console.log(err); 82 | }); 83 | message.channel.send(embed 84 | .setDescription(`${hedef}, ${message.author} Tarafından Güvenli Listeden \`Çıkarıldı.\``)); 85 | } else { 86 | Güvenliler.whitelist.push(`S${hedef.id}`); 87 | fs.writeFile("./ayarlar.json", JSON.stringify(Güvenliler), (err) => { 88 | if (err) console.log(err); 89 | }); 90 | message.channel.send(embed 91 | .setDescription(`${hedef}, ${message.author} Tarafından Güvenli Listeye \`Eklendi.\``)); 92 | }; 93 | }; 94 | }); 95 | 96 | Guard_2.on("message", async message => { 97 | if (message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(Settings.Prefix.Guard_2P)) return; 98 | if (message.author.id !== Settings.Server.OwnerID && message.author.id !== message.guild.owner.id) return; 99 | let args = message.content.split(' ').slice(1); 100 | let command = message.content.split(' ')[0].slice(Settings.Prefix.Guard_2P.length); 101 | let embed = new MessageEmbed().setColor(Settings.Server.EmbedColor).setAuthor(message.member.displayName, message.author.avatarURL({ dynamic: true, })) 102 | if (command === "eval" && message.author.id === Settings.Server.OwnerID) { 103 | if (!args[0]) return ; 104 | let code = args.join(' '); 105 | function clean(text) { 106 | if (typeof text !== 'string') text = require('util').inspect(text, { depth: 0 }) 107 | text = text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203)) 108 | return text; 109 | }; 110 | try { 111 | var evaled = clean(await eval(code)); 112 | if(evaled.match(new RegExp(`${Guard_2.token}`, 'g'))) evaled.replace(Guard_2.token, "Yasaklı komut"); 113 | message.channel.send(`${evaled.replace(Guard_2.token, "Yasaklı komut")}`, {code: "js", split: true}); 114 | } catch(err) { message.channel.send(err, {code: "js", split: true}) }; 115 | }; 116 | 117 | }); 118 | 119 | Guard_3.on("message", async message => { 120 | if (message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(Settings.Prefix.Guard_3P)) return; 121 | if (message.author.id !== Settings.Server.OwnerID && message.author.id !== message.guild.owner.id) return; 122 | let args = message.content.split(' ').slice(1); 123 | let command = message.content.split(' ')[0].slice(Settings.Prefix.Guard_3P.length); 124 | let embed = new MessageEmbed().setColor(Settings.Server.EmbedColor).setAuthor(message.member.displayName, message.author.avatarURL({ dynamic: true, })); 125 | if (command === "eval" && message.author.id === Settings.Server.OwnerID) { 126 | if (!args[0]) return; 127 | let code = args.join(' '); 128 | function clean(text) { 129 | if (typeof text !== 'string') text = require('util').inspect(text, { depth: 0 }) 130 | text = text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203)) 131 | return text; 132 | }; 133 | try { 134 | var evaled = clean(await eval(code)); 135 | if(evaled.match(new RegExp(`${Guard_3.token}`, 'g'))) evaled.replace(Guard_3.token, "Yasaklı komut"); 136 | message.channel.send(`${evaled.replace(Guard_3.token, "Yasaklı komut")}`, {code: "js", split: true}); 137 | } catch(err) { message.channel.send(err, {code: "js", split: true}) }; 138 | }; 139 | 140 | }); 141 | 142 | 143 | 144 | 145 | 146 | // CEZA / 147 | 148 | function guvenli(kisiID) { 149 | let uye = Guard_1.guilds.cache.get(Settings.Server.GuildID).members.cache.get(kisiID); 150 | let guvenliler = Güvenliler.whitelist || []; 151 | if (!uye || uye.id === Guard_1.user.id || uye.id === Settings.Server.OwnerID || uye.id === uye.guild.owner.id || guvenliler.some(g => uye.id === g.slice(1) || uye.roles.cache.has(g.slice(1)))) return true 152 | else return false; 153 | }; 154 | 155 | function cezalandir(kisiID, tur) { 156 | let uye = Guard_1.guilds.cache.get(Settings.Server.GuildID).members.cache.get(kisiID); 157 | if (!uye) return; 158 | if (tur == "jail") return uye.roles.cache.has(Settings.Roles.BoosterRole) ? uye.roles.set([Settings.Roles.BoosterRole, Settings.Roles.JailRoles]) : uye.roles.set([Settings.Roles.JailRoles]); 159 | if (tur == "ban") return uye.ban({ reason: "Satuke Koruma Sistemi" }).catch(); 160 | }; 161 | 162 | function guvenli(kisiID) { 163 | let uye = Guard_2.guilds.cache.get(Settings.Server.GuildID).members.cache.get(kisiID); 164 | let guvenliler = Güvenliler.whitelist || []; 165 | if (!uye || uye.id === Guard_2.user.id || uye.id === Settings.Server.OwnerID || uye.id === uye.guild.owner.id || guvenliler.some(g => uye.id === g.slice(1) || uye.roles.cache.has(g.slice(1)))) return true 166 | else return false; 167 | }; 168 | 169 | function cezalandir(kisiID, tur) { 170 | let uye = Guard_2.guilds.cache.get(Settings.Server.GuildID).members.cache.get(kisiID); 171 | if (!uye) return; 172 | if (tur == "jail") return uye.roles.cache.has(Settings.Roles.BoosterRole) ? uye.roles.set([Settings.Roles.BoosterRole, Settings.Roles.JailRoles]) : uye.roles.set([Settings.Roles.JailRoles]); 173 | if (tur == "ban") return uye.ban({ reason: "Satuke Koruma Sistemi" }).catch(); 174 | }; 175 | 176 | function guvenli(kisiID) { 177 | let uye = Guard_3.guilds.cache.get(Settings.Server.GuildID).members.cache.get(kisiID); 178 | let guvenliler = Güvenliler.whitelist || []; 179 | if (!uye || uye.id === Guard_3.user.id || uye.id === Settings.Server.OwnerID || uye.id === uye.guild.owner.id || guvenliler.some(g => uye.id === g.slice(1) || uye.roles.cache.has(g.slice(1)))) return true 180 | else return false; 181 | }; 182 | 183 | function cezalandir(kisiID, tur) { 184 | let uye = Guard_3.guilds.cache.get(Settings.Server.GuildID).members.cache.get(kisiID); 185 | if (!uye) return; 186 | if (tur == "jail") return uye.roles.cache.has(Settings.Roles.BoosterRole) ? uye.roles.set([Settings.Roles.BoosterRole, Settings.Roles.JailRoles]) : uye.roles.set([Settings.Roles.JailRoles]); 187 | if (tur == "ban") return uye.ban({ reason: "Satuke Koruma Sistemi" }).catch(); 188 | }; 189 | 190 | // SERVER GUARD / 191 | 192 | Guard_1.on("guildMemberRemove", async member => { 193 | let entry = await member.guild.fetchAuditLogs({type: 'MEMBER_KICK'}).then(audit => audit.entries.first()); 194 | if (!entry || !entry.executor || Date.now()-entry.createdTimestamp > 5000 || guvenli(entry.executor.id) || !korumalar.kickGuard) return; 195 | cezalandir(entry.executor.id, "ban"); 196 | let logKanali = Guard_1.channels.cache.find(a => a.name == Settings.Log.Guard_Log1) 197 | if (logKanali) { logKanali.send(`🛡️ ${member} (\`${member.id}\`), adlı kullanıcıya ${entry.executor} (\`${entry.executor.id}\`) tarafından sağ tık \`Kick\` atıldı`).catch(); } 198 | else { member.guild.owner.send(`🛡️ ${member} (\`${member.id}\`), adlı kullanıcıya ${entry.executor} (\`${entry.executor.id}\`) tarafından sağ tık \`Kick\` atıldı`).catch(err => {}); }; 199 | }); 200 | 201 | Guard_1.on("guildBanAdd", async (guild, user) => { 202 | let entry = await guild.fetchAuditLogs({type: 'MEMBER_BAN_ADD'}).then(audit => audit.entries.first()); 203 | if (!entry || !entry.executor || guvenli(entry.executor.id) || !korumalar.banGuard) return; 204 | cezalandir(entry.executor.id, "ban"); 205 | guild.members.unban(user.id, "Kullanıcıya Sağ Tık Ban Atıldığı İçin Banı Açıldı.").catch(console.error); 206 | let logKanali = Guard_1.channels.cache.find(a => a.name == Settings.Log.Guard_Log1) 207 | if (!logKanali) return console.log('Koruma Logu Yok'); 208 | if (logKanali) { logKanali.send(`${members} (\`${member.id}\`), adlı kullanıcıya ${entry.executor} (\`${entry.executor.id}\`) tarafından sağ tık \`Ban\` atıldı, @everyone`).catch(); } 209 | else {guild.owner.send(`🛡️ ${members} (\`${member.id}\`), adlı kullanıcıya ${entry.executor} (\`${entry.executor.id}\`) tarafından sağ tık \`Ban\` atıldı, @everyone`).catch(err => {}); }; 210 | }); 211 | 212 | Guard_1.on("guildMemberAdd", async member => { 213 | let entry = await member.guild.fetchAuditLogs({type: 'BOT_ADD'}).then(audit => audit.entries.first()); 214 | if (!member.user.bot || !entry || !entry.executor || Date.now()-entry.createdTimestamp > 5000 || guvenli(entry.executor.id) || !korumalar.botGuard) return; 215 | cezalandir(entry.executor.id, "ban"); 216 | cezalandir(member.id, "ban"); 217 | let logKanali = Guard_1.channels.cache.find(a => a.name == Settings.Log.Guard_Log1) 218 | if (!logKanali) return console.log('Koruma Logu Yok'); 219 | if (logKanali) { logKanali.send(`🛡️ ${member} (\`${member.id}\`), adlı bot ${entry.executor} (\`${entry.executor.id}\`) tarafından sunucuya \`Eklendi\`, @everyone`).catch(); } 220 | else{ member.guild.owner.send(`🛡️ ${member} (\`${member.id}\`), adlı bot ${entry.executor} (\`${entry.executor.id}\`) tarafından sunucuya \`Eklendi\`, @everyone`).catch(err => {}); }; 221 | }); 222 | 223 | Guard_1.on("guildUpdate", async (oldGuild, newGuild) => { 224 | let entry = await newGuild.fetchAuditLogs({type: 'GUILD_UPDATE'}).then(audit => audit.entries.first()); 225 | if (!entry || !entry.executor || Date.now()-entry.createdTimestamp > 3000 || guvenli(entry.executor.id) || !korumalar.serverGuard) return; 226 | cezalandir(entry.executor.id, "ban"); 227 | if (newGuild.name !== oldGuild.name) newGuild.setName(oldGuild.name); 228 | if (newGuild.iconURL({dynamic: true, size: 2048}) !== oldGuild.iconURL({dynamic: true, size: 2048})) newGuild.setIcon(oldGuild.iconURL({dynamic: true, size: 2048})); 229 | let logKanali = Guard_1.channels.cache.find(a => a.name == Settings.Log.Guard_Log1) 230 | if (!logKanali) return console.log('Koruma Logu Yok'); 231 | if (logKanali) { logKanali.send(`${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından \`Sunucu Ayarları'nı\` güncellendi, @everyone`).catch(); } 232 | else { newGuild.owner.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından \`Sunucu Ayarları'nı\` güncellendi, @everyone `).catch(err => {}); }; 233 | }); 234 | 235 | Guard_1.on("webhookUpdate", async (channel) => { 236 | const entry = await channel.guild.fetchAuditLogs({type: 'WEBHOOK_CREATE'}).then(audit => audit.entries.first()); 237 | if(!entry || !entry.executor || Date.now()-entry.createdTimestamp > 10000) return; 238 | if (!entry || !entry.executor || guvenli(entry.executor.id) || !korumalar.webhookGuard) return; 239 | const webhooks = await channel.fetchWebhooks(); 240 | await webhooks.map(x => x.delete({reason: "Satuke || Webhook Sistemi"})) 241 | cezalandir(entry.executor.id, "ban"); 242 | let logKanali = Guard_1.channels.cache.find(a => a.name == Settings.Log.Guard_Log1) 243 | if (!logKanali) return console.log('Koruma Logu Yok'); 244 | if (logKanali) { logKanali.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından izinsiz şekilde \`Webhook\` açıldı, @everyone`).catch(err => {}); }; 245 | }); 246 | 247 | Guard_1.on("emojiDelete", async (emoji, message) => { 248 | const entry = await emoji.guild.fetchAuditLogs({ type: "EMOJI_DELETE" }).then(audit => audit.entries.first()); 249 | if(!entry || !entry.executor || Date.now()-entry.createdTimestamp > 10000) return; 250 | if (!entry || !entry.executor || guvenli(entry.executor.id) || !korumalar.emojiDelete) return; 251 | emoji.guild.emojis.create(`${emoji.url}`, `${emoji.name}`).catch(console.error); 252 | cezalandir(entry.executor.id, "ban"); 253 | let logKanali = Guard_1.channels.cache.find(a => a.name == Settings.Log.Guard_Log1) 254 | if (!logKanali) return console.log('Koruma Logu Yok'); 255 | if (logKanali) { logKanali.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından, \`Emoji\` silindi.`).catch(err => {}); }; 256 | }); 257 | 258 | Guard_1.on("emojiCreate", async (emoji, message) => { 259 | const entry = await emoji.guild.fetchAuditLogs({ type: "EMOJI_CREATE" }).then(audit => audit.entries.first()); 260 | if(!entry || !entry.executor || Date.now()-entry.createdTimestamp > 10000) return; 261 | if (!entry || !entry.executor || guvenli(entry.executor.id) || !korumalar.emojiCreate) return; 262 | emoji.delete({reason: "Satuke | Emoji Koruma Sistemi"}); 263 | cezalandir(entry.executor.id, "jail"); 264 | let logKanali = Guard_1.channels.cache.find(a => a.name == Settings.Log.Guard_Log1) 265 | if (!logKanali) return console.log('Koruma Logu Yok'); 266 | if (logKanali) { logKanali.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından, \`Emoji\` yüklendi`).catch(err => {}); }; 267 | }); 268 | 269 | Guard_1.on("emojiUpdate", async (oldEmoji, newEmoji) => { 270 | if(oldEmoji === newEmoji) return; 271 | const entry = await oldEmoji.guild.fetchAuditLogs({ type: "EMOJI_UPDATE" }).then(audit => audit.entries.first()); 272 | if(!entry || !entry.executor || Date.now()-entry.createdTimestamp > 10000) return; 273 | if (!entry || !entry.executor || guvenli(entry.executor.id) || !korumalar.emojiUpdate) return; 274 | cezalandir(entry.executor.id, "jail"); 275 | await newEmoji.setName(oldEmoji.name); 276 | let logKanali = Guard_1.channels.cache.find(a => a.name == Settings.Log.Guard_Log1) 277 | if (!logKanali) return console.log('Koruma Logu Yok'); 278 | if (logKanali) { logKanali.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından, \`Emoji\` güncellendi`).catch(err => {}); }; 279 | }); 280 | 281 | Guard_1.on("guildBanRemove", async(guild, user) => { 282 | let entry = await guild.fetchAuditLogs({ type: "MEMBER_BAN_REMOVE" }).then((audit) => audit.entries.first()); 283 | if (!entry || !entry.executor || guvenli(entry.executor.id) || !korumalar.banRemove) return; 284 | cezalandir(entry.executor.id, "jail"); 285 | guild.members.ban(entry.executor.id, { reason: "Banı Kaldırıldı Tekrar Atıldı || Satuke Security System" }); 286 | guild.members.ban(user.id, { reason: "Banı Kaldırıldı Tekrar Atıldı || Satuke Security System" }); 287 | let logKanali = Guard_1.channels.cache.find(a => a.name == Settings.Log.Guard_Log1) 288 | if (!logKanali) return console.log('Koruma Logu Yok'); 289 | if (logKanali) { logKanali.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı birisinin İzinsiz \`Banını\` kaldırdı`).catch(err => {}); }; 290 | }); 291 | 292 | 293 | Guard_1.on('guildUpdate', async (oldGuild, newGuild) => { 294 | if (oldGuild.vanityURLCode === newGuild.vanityURLCode) return; 295 | let entry = await newGuild.fetchAuditLogs({ type: 'GUILD_UPDATE' }).then(audit => audit.entries.first()); 296 | if (!entry.executor || entry.executor.id === Guard_1.user.id) return; 297 | let channel = Guard_1.channels.cache.find(x => x.name == Settings.Log.Guard_Log2) 298 | if (channel) channel.send(`🔐 ${entry.executor} (\`${entry.executor.id}\`) Sunucunun **${Settings.Server.VanityURL} adlı urlyi değiştirmeye çalıştı!, @everyone`) 299 | if (!channel) newGuild.owner.send(`🔐 ${entry.executor} ${entry.executor.id} Sunucunun **${Settings.Server.VanityURL} adlı urlyi değiştirmeye çalıştı! (Log Kanalını Bulamadığım İçin sana attım!)`) 300 | newGuild.members.ban(entry.executor.id, { reason: `URL Değiştirme | (Vanity Url Guard).`}); 301 | 302 | const bisiylerdeniyom = { 303 | url: `https://discord.com/api/v6/guilds/${newGuild.id}/vanity-url`, 304 | body: { 305 | code: Settings.Server.VanityURL }, 306 | json: true, 307 | method: 'PATCH', 308 | headers: { "Authorization": `Bot ${Settings.Token.Guard_1}` } 309 | }; 310 | 311 | request(bisiylerdeniyom, (err, res, body) => { 312 | if (err) { 313 | return console.log(err); 314 | } 315 | }); 316 | }); 317 | 318 | // CHANNEL GUARD / 319 | 320 | Guard_2.on("channelCreate", async channel => { 321 | let entry = await channel.guild.fetchAuditLogs({type: 'CHANNEL_CREATE'}).then(audit => audit.entries.first()); 322 | if (!entry || !entry.executor || Date.now()-entry.createdTimestamp > 3000 || guvenli(entry.executor.id) || !korumalar.channelCreate) return; 323 | channel.delete({reason: "Kanal Açma Koruması"}); 324 | cezalandir(entry.executor.id, "ban"); 325 | let logKanali = Guard_2.channels.cache.find(a => a.name == Settings.Log.Guard_Log2) 326 | if (logKanali) { logKanali.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından yeni bir \`Kanal\` oluşturuldu, @everyone`).catch(); } 327 | else { channel.guild.owner.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından yeni bir \`Kanal\` oluşturuldu, @everyone `).catch(err => {}); }; 328 | }); 329 | 330 | Guard_2.on("channelUpdate", async (oldChannel, newChannel) => { 331 | let entry = await newChannel.guild.fetchAuditLogs({type: 'CHANNEL_UPDATE'}).then(audit => audit.entries.first()); 332 | if (!entry || !entry.executor || !newChannel.guild.channels.cache.has(newChannel.id) || Date.now()-entry.createdTimestamp > 3000 || guvenli(entry.executor.id) || !korumalar.channelUpdate) return; 333 | cezalandir(entry.executor.id, "jail"); 334 | if (newChannel.type !== "category" && newChannel.parentID !== oldChannel.parentID) newChannel.setParent(oldChannel.parentID); 335 | if (newChannel.type === "category") { 336 | newChannel.edit({ 337 | name: oldChannel.name, 338 | }); 339 | } else if (newChannel.type === "text") { 340 | newChannel.edit({ 341 | name: oldChannel.name, 342 | topic: oldChannel.topic, 343 | nsfw: oldChannel.nsfw, 344 | rateLimitPerUser: oldChannel.rateLimitPerUser 345 | }); 346 | } else if (newChannel.type === "voice") { 347 | newChannel.edit({ 348 | name: oldChannel.name, 349 | bitrate: oldChannel.bitrate, 350 | userLimit: oldChannel.userLimit, 351 | }); 352 | }; 353 | oldChannel.permissionOverwrites.forEach(perm => { 354 | let thisPermOverwrites = {}; 355 | perm.allow.toArray().forEach(p => { 356 | thisPermOverwrites[p] = true; 357 | }); 358 | perm.deny.toArray().forEach(p => { 359 | thisPermOverwrites[p] = false; 360 | }); 361 | newChannel.createOverwrite(perm.id, thisPermOverwrites); 362 | }); 363 | let logKanali = Guard_2.channels.cache.find(a => a.name == Settings.Log.Guard_Log2); 364 | if (!logKanali) return console.log('Koruma Logu Yok'); 365 | if (logKanali) { logKanali.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı \`${oldChannel.name}\` adlı kanalı \`Güncelledi\, @everyone`).catch(); } 366 | else { newChannel.guild.owner.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı \`${oldChannel.name}\` adlı kanalı \`Güncelledi\`, @everyone`).catch(err => {}); }; 367 | }); 368 | 369 | Guard_2.on("channelDelete", async channel => { 370 | let entry = await channel.guild.fetchAuditLogs({type: 'CHANNEL_DELETE'}).then(audit => audit.entries.first()); 371 | if (!entry || !entry.executor || Date.now()-entry.createdTimestamp > 3000 || guvenli(entry.executor.id) || !korumalar.channelDelete) return; 372 | cezalandir(entry.executor.id, "ban"); 373 | await channel.clone({ reason: "Satuke Kanal Silme Koruması" }).then(async kanal => { 374 | if (channel.parentID != null) await kanal.setParent(channel.parentID); 375 | await kanal.setPosition(channel.position); 376 | if (channel.type == "category") await channel.guild.channels.cache.filter(k => k.parentID == channel.id).forEach(x => x.setParent(kanal.id));}); 377 | let logKanali = Guard_2.channels.cache.find(a => a.name == Settings.Log.Guard_Log2); 378 | if (!logKanali) return console.log('Koruma Logu Yok'); 379 | if (logKanali) { logKanali.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından \`${channel.name}\` adlı kanalı \`Sildi\`, @everyone`).catch()} 380 | else { channel.guild.owner.send(`🛡️ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı tarafından \`${channel.name}\` adlı kanalı \`Sildi\`, @everyone`).catch(err => {}); }; 381 | }); 382 | 383 | 384 | Guard_2.on('guildUpdate', async (oldGuild, newGuild) => { 385 | if (oldGuild.vanityURLCode === newGuild.vanityURLCode) return; 386 | let entry = await newGuild.fetchAuditLogs({ type: 'GUILD_UPDATE' }).then(audit => audit.entries.first()); 387 | if (!entry.executor || entry.executor.id === Guard_2.user.id) return; 388 | let channel = Guard_2.channels.cache.find(x => x.name == Settings.Log.Guard_Log2) 389 | if (channel) channel.send(`🔐 ${entry.executor} (\`${entry.executor.id}\`) Sunucunun **${Settings.Server.VanityURL} adlı urlyi değiştirmeye çalıştı!, @everyone`) 390 | if (!channel) newGuild.owner.send(`🔐 ${entry.executor} ${entry.executor.id} Sunucunun **${Settings.Server.VanityURL} adlı urlyi değiştirmeye çalıştı! (Log Kanalını Bulamadığım İçin sana attım!)`) 391 | newGuild.members.ban(entry.executor.id, { reason: `URL Değiştirme | (Vanity Url Guard).`}); 392 | 393 | const bisiylerdeniyom = { 394 | url: `https://discord.com/api/v6/guilds/${newGuild.id}/vanity-url`, 395 | body: { 396 | code: Settings.Server.VanityURL }, 397 | json: true, 398 | method: 'PATCH', 399 | headers: { "Authorization": `Bot ${Settings.Token.Guard_2}` } 400 | }; 401 | 402 | request(bisiylerdeniyom, (err, res, body) => { 403 | if (err) { 404 | return console.log(err); 405 | } 406 | }); 407 | }); 408 | 409 | 410 | // ROLE GUARD / 411 | 412 | Guard_3.on("guildMemberUpdate", async (oldMember, newMember) => { 413 | if (newMember.roles.cache.size > oldMember.roles.cache.size) { 414 | let entry = await newMember.guild.fetchAuditLogs({type: 'MEMBER_ROLE_UPDATE'}).then(audit => audit.entries.first()); 415 | if (!entry || !entry.executor || Date.now()-entry.createdTimestamp > 5000 || guvenli(entry.executor.id) || !korumalar.roleMemberUpdate) return; 416 | if (PermArray.some(p => !oldMember.hasPermission(p) && newMember.hasPermission(p))) { 417 | cezalandir(entry.executor.id, "jail"); 418 | newMember.roles.set(oldMember.roles.cache.map(r => r.id)); 419 | let logKanali = Guard_3.channels.cache.find(a => a.name == Settings.Log.Guard_Log3) 420 | if (logKanali) { logKanali.send(`🛡️ ${newMember} (\`${newMember.id}\`) Adlı kullanıcıya ${entry.executor} (\`${entry.executor.id}\`) Tarafından \`Sağ Tık Rol\` verildi, yetkileri çekildi, @everyone`).catch(); } 421 | else { newMember.guild.owner.send(`🛡️ ${newMember} (\`${newMember.id}\`) Adlı kullanıcıya ${entry.executor} (\`${entry.executor.id}\`) Tarafından \`Sağ Tık Rol\` verildi, yetkileri çekildi, @everyone`).catch(err => {}); }; 422 | }; 423 | }; 424 | }); 425 | 426 | Guard_3.on("roleCreate", async role => { 427 | let entry = await role.guild.fetchAuditLogs({type: 'ROLE_CREATE'}).then(audit => audit.entries.first()); 428 | if (!entry || !entry.executor || Date.now()-entry.createdTimestamp > 5000 || guvenli(entry.executor.id) || !korumalar.roleCreate) return; 429 | role.delete({ reason: "Rol açma koruması." }); 430 | cezalandir(entry.executor.id, "ban"); 431 | let logKanali = Guard_3.channels.cache.find(a => a.name == Settings.Log.Guard_Log3); 432 | if (logKanali) { logKanali.send(`⛔ ${entry.executor} (\`${entry.executor.id}\`) Adlı kullanıcı tarafından \`Rol\` oluşturuldu, @everyone`).catch(); } 433 | else { role.guild.owner.send(`⛔ ${entry.executor} (\`${entry.executor.id}\`) Adlı kullanıcı tarafından \`Rol\` oluşturuldu, @everyone`).catch(err => {}); }; 434 | }); 435 | 436 | Guard_3.on("roleUpdate", async (oldRole, newRole) => { 437 | let entry = await newRole.guild.fetchAuditLogs({type: 'ROLE_UPDATE'}).then(audit => audit.entries.first()); 438 | if (!entry || !entry.executor || !newRole.guild.roles.cache.has(newRole.id) || Date.now()-entry.createdTimestamp > 3000 || guvenli(entry.executor.id) || !korumalar.roleUpdate) return; 439 | cezalandir(entry.executor.id, "jail"); 440 | if (PermArray.some(p => !oldRole.permissions.has(p) && newRole.permissions.has(p))) { 441 | newRole.setPermissions(oldRole.permissions); 442 | 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)); 443 | }; 444 | newRole.edit({ 445 | name: oldRole.name, 446 | color: oldRole.hexColor, 447 | hoist: oldRole.hoist, 448 | permissions: oldRole.permissions, 449 | mentionable: oldRole.mentionable 450 | }); 451 | let logKanali = Guard_3.channels.cache.find(a => a.name == Settings.Log.Guard_Log3); 452 | if (logKanali) { logKanali.send(`⛔ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı \`${oldRole.name}\` adlı rolü \`Güncelledi\`, @everyone`).catch(); } 453 | else { newRole.guild.owner.send(`⛔ ${entry.executor} (\`${entry.executor.id}\`) adlı kullanıcı \`${oldRole.name}\` adlı rolü \`Güncelledi\`, @everyone`).catch(err => {}); }; 454 | }); 455 | 456 | Guard_3.on("roleDelete", async role => { 457 | let entry = await role.guild.fetchAuditLogs({type: 'ROLE_DELETE'}).then(audit => audit.entries.first()); 458 | if (!entry || !entry.executor || Date.now()-entry.createdTimestamp > 5000 || guvenli(entry.executor.id) || !korumalar.roleDelete) return; 459 | cezalandir(entry.executor.id, "ban"); 460 | let yeniRol = await role.guild.roles.create({ 461 | data: { 462 | name: role.name, 463 | color: role.hexColor, 464 | hoist: role.hoist, 465 | position: role.position, 466 | permissions: role.permissions, 467 | mentionable: role.mentionable 468 | }, 469 | reason: "Rol Silindiği İçin Tekrar Oluşturuldu!" 470 | }); 471 | 472 | Database.findOne({guildID: role.guild.id, roleID: role.id}, async (err, roleData) => { 473 | if (!roleData) return; 474 | setTimeout(() => { 475 | let kanalPermVeri = roleData.channelOverwrites; 476 | if (kanalPermVeri) kanalPermVeri.forEach((perm, index) => { 477 | let kanal = role.guild.channels.cache.get(perm.id); 478 | if (!kanal) return; 479 | setTimeout(() => { 480 | let yeniKanalPermVeri = {}; 481 | perm.allow.forEach(p => { 482 | yeniKanalPermVeri[p] = true; 483 | }); 484 | perm.deny.forEach(p => { 485 | yeniKanalPermVeri[p] = false; 486 | }); 487 | kanal.createOverwrite(yeniRol, yeniKanalPermVeri).catch(console.error); 488 | }, index*5000); 489 | }); 490 | }, 5000); 491 | 492 | let roleMembers = roleData.members; 493 | roleMembers.forEach((member, index) => { 494 | let uye = role.guild.members.cache.get(member); 495 | if (!uye || uye.roles.cache.has(yeniRol.id)) return; 496 | setTimeout(() => { 497 | uye.roles.add(yeniRol.id).catch(); 498 | }, index*3000); 499 | }); 500 | }); 501 | 502 | let logKanali = Guard_3.channels.cache.find(a => a.name == Settings.Log.Guard_Log3); 503 | if (logKanali) { logKanali.send(`⛔ ${entry.executor} (\`${entry.executor.id}\`) Adlı kullanıcı tarafından \`${role.name}\` (\`${role.id}\`) adlı rol \`Silindi\`, @everyone`).catch(); } 504 | else { 505 | role.guild.owner.send(`⛔ ${entry.executor} (\`${entry.executor.id}\`) Adlı kullanıcı tarafından \`${role.name}\` (\`${role.id}\`) adlı rol \`Silindi\, @everyone\``).catch(err => {}); }; 506 | 507 | }) 508 | 509 | 510 | 511 | Guard_1.on("ready", async () => { 512 | Guard_1.user.setPresence({ activity: { name: Settings.Server.Status }, status: "dnd" }) 513 | let botVoiceChannel = Guard_1.channels.cache.get(Settings.Server.VoiceChannel); 514 | if (botVoiceChannel) botVoiceChannel.join().catch(err => console.error("[GUARD 1] Sese Bağlanamadı!")); 515 | }); 516 | 517 | Guard_2.on("ready", async () => { 518 | Guard_2.user.setPresence({ activity: { name: Settings.Server.Status }, status: "dnd" }) 519 | let botVoiceChannel = Guard_2.channels.cache.get(Settings.Server.VoiceChannel); 520 | if (botVoiceChannel) botVoiceChannel.join().catch(err => console.error("[GUARD 1] Sese Bağlanamadı!")); 521 | }); 522 | 523 | Guard_3.on("ready", async () => { 524 | Guard_3.user.setPresence({ activity: { name: Settings.Server.Status }, status: "dnd" }) 525 | let botVoiceChannel = Guard_3.channels.cache.get(Settings.Server.VoiceChannel); 526 | if (botVoiceChannel) botVoiceChannel.join().catch(err => console.error("[GUARD 1] Sese Bağlanamadı!")); 527 | 528 | }); 529 | 530 | 531 | 532 | Guard_1.on('warn', m => console.log(`[WARN]:${m}`)); 533 | Guard_1.on('error', m => console.log(`[ERROR]: ${m}`)); 534 | Guard_1.on("disconnect", () => console.log("Bot bağlantısı kesildi")) 535 | Guard_1.on("reconnecting", () => console.log("Bot tekrar bağlanıyor...")) 536 | process.on('uncaughtException', error => console.log(`[ERROR]: ${error}`)); 537 | process.on('unhandledRejection', err => console.log(`[ERROR]: ${err}`)); 538 | 539 | 540 | Guard_2.on('warn', m => console.log(`[WARN]:${m}`)); 541 | Guard_2.on('error', m => console.log(`[ERROR]: ${m}`)); 542 | Guard_2.on("disconnect", () => console.log("Bot bağlantısı kesildi")) 543 | Guard_2.on("reconnecting", () => console.log("Bot tekrar bağlanıyor...")) 544 | process.on('uncaughtException', error => console.log(`[ERROR]: ${error}`)); 545 | process.on('unhandledRejection', err => console.log(`[ERROR]: ${err}`)); 546 | 547 | 548 | Guard_3.on('warn', m => console.log(`[WARN]:${m}`)); 549 | Guard_3.on('error', m => console.log(`[ERROR]: ${m}`)); 550 | Guard_3.on("disconnect", () => console.log("Bot bağlantısı kesildi")) 551 | Guard_3.on("reconnecting", () => console.log("Bot tekrar bağlanıyor...")) 552 | process.on('uncaughtException', error => console.log(`[ERROR]: ${error}`)); 553 | process.on('unhandledRejection', err => console.log(`[ERROR]: ${err}`)); 554 | 555 | 556 | 557 | Guard_1.login(Settings.Token.Guard_1).then(x => console.log(`[GUARD 1] - Olarak Başarıyla Giriş Yapıldı!`)).catch(err => console.error(`[ERROR] Hata : ${err}`)) 558 | Guard_2.login(Settings.Token.Guard_2).then(x => console.log(`[GUARD 2] - Olarak Başarıyla Giriş Yapıldı!`)).catch(err => console.error(`[ERROR] Hata : ${err}`)) 559 | Guard_3.login(Settings.Token.Guard_3).then(x => console.log(`[GUARD 3] - Olarak Başarıyla Giriş Yapıldı!`)).catch(err => console.error(`[ERROR] Hata : ${err}`)) 560 | -------------------------------------------------------------------------------- /TheSatuke/Models/Database/RoleGuard.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | const role = mongoose.Schema({ 4 | _id: mongoose.Schema.Types.ObjectId, 5 | guildID: String, 6 | roleID: String, 7 | name: String, 8 | color: String, 9 | hoist: Boolean, 10 | position: Number, 11 | permissions: Number, 12 | mentionable: Boolean, 13 | time: Number, 14 | members: Array, 15 | channelOverwrites: Array 16 | }); 17 | 18 | module.exports = mongoose.model("Roles", role); -------------------------------------------------------------------------------- /TheSatuke/Models/Guard.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "kickGuard":true, 4 | "banGuard":true, 5 | "botGuard":true, 6 | "serverGuard":true, 7 | "webhookGuard":true, 8 | "emojiDelete":true, 9 | "emojiCreate":true, 10 | "emojiUpdate":true, 11 | "banRemove":true, 12 | "roleUpdate":true, 13 | "roleDelete":true, 14 | "roleCreate":true, 15 | "roleMemberUpdate":true, 16 | "channelUpdate":true, 17 | "channelDelete":true, 18 | "channelCreate":true, 19 | "Vanity_Guard":true 20 | } -------------------------------------------------------------------------------- /TheSatuke/Models/Güvenliler.json: -------------------------------------------------------------------------------- 1 | { 2 | "Createdbysatuke":"", 3 | "whitelist":[]} 4 | -------------------------------------------------------------------------------- /TheSatuke/Models/RoleBackup.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | const role = mongoose.Schema({ 4 | _id: mongoose.Schema.Types.ObjectId, 5 | guildID: String, 6 | roleID: String, 7 | name: String, 8 | color: String, 9 | hoist: Boolean, 10 | position: Number, 11 | permissions: Number, 12 | mentionable: Boolean, 13 | time: Number, 14 | members: Array, 15 | channelOverwrites: Array 16 | }); 17 | 18 | module.exports = mongoose.model("RoleDatabase", role); -------------------------------------------------------------------------------- /TheSatuke/Models/Web.js: -------------------------------------------------------------------------------- 1 | const { Schema, model } = require("mongoose"); 2 | 3 | const WEBGUARD = Schema({ 4 | guildID: { type: String, default: "" }, 5 | userID: { type: String, default: "" }, 6 | roles: { type: Array, default: [] } 7 | }); 8 | 9 | module.exports = model("userRoles", WEBGUARD); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "satuke-moderation", 3 | "version": "1.0.0", 4 | "description": "satuke", 5 | "main": "Satuke.js", 6 | "scripts": { 7 | "test": "node Satuke.js" 8 | }, 9 | "keywords": [ 10 | "satuke" 11 | ], 12 | "author": "satke", 13 | "license": "ISC", 14 | "dependencies": { 15 | "debug": "^4.3.2", 16 | "discord-reply": "^0.1.2", 17 | "discord.js": "^12.5.3", 18 | "mathjs": "^9.4.4", 19 | "moment": "^2.29.1", 20 | "mongoose": "^5.13.12", 21 | "request": "^2.88.2", 22 | "yarn": "^1.22.11" 23 | } 24 | } 25 | --------------------------------------------------------------------------------