const { AttachmentBuilder, EmbedBuilder, PermissionsBitField, ActionRowBuilder, ButtonBuilder, ButtonStyle, ModalBuilder, TextInputStyle, TextInputBuilder, Formatters, StringSelectMenuBuilder } = require("discord.js");
const guard = require("../../../../../Ertu-Guard/Schemas/Guard");
const ertucuk = require("../../../../../../Global/Settings/System");
const guardPenalty = require("../../../../../Ertu-Guard/Schemas/guardPenalty");
const rolePermissions = require("../../../../../Ertu-Guard/Schemas/rolePermissions");
const { exec } = require("child_process");

module.exports = {
  name: "panel",
  description: "Guard Kontrol Paneli",
  category: "OWNER",
  cooldown: 0,
  command: {
    enabled: true,
    aliases: ["panel", "guard", "guardpanel", "p"],
    usage: ".panel",
  },


  onLoad: function (client) { },

  onCommand: async function (client, message, args, ertuembed) {

    const ayarbutonlarÄ± = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder().setCustomId("sunucuayarkoruma").setLabel("Sunucu Ayar KorumasÄ±").setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId("rolkoruma").setLabel("Rol KorumasÄ±").setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId("kanalkoruma").setLabel("Kanal KorumasÄ±").setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId("bankickkoruma").setLabel("Ban/Kick KorumasÄ±").setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId("emojistickerskoruma").setLabel("Emoji/Stickers KorumasÄ±").setStyle(ButtonStyle.Secondary),
      )
    const ayarbutonlarÄ±2 = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder().setCustomId("chatguard").setLabel("Chat Guard KorumasÄ±").setStyle(ButtonStyle.Secondary),
      )
    const ayaryedekleme = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder().setCustomId("yetkiac").setLabel("Yetkileri AÃ§/Kapat").setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId("urlspammer").setLabel("URL Spammer").setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId("kanalyedek").setLabel("KanallarÄ±/Rolleri Yedekle").setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId("weboffline").setLabel("Web/Ã‡evrimdÄ±ÅŸÄ± GÃ¼venlik").setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId("database").setLabel("Yedekleme AÃ§/Kapat").setStyle(ButtonStyle.Secondary),
      )
    let guardEmoji = message.guild.emojis.cache.find(x => x.name == "ok") ? message.guild.emojis.cache.find(x => x.name == "ok") : "â€¢"
    const dataguard = await guard.findOne({ guildID: message.guild.id })
    const safedMembers = dataguard ? dataguard.SafedMembers : client.owners
    var adminmenu = [];
    const admins = await message.guild.members.cache.filter(member => !member.user.bot && member.permissions.has(PermissionsBitField.Flags.Administrator)).map(async x => await adminmenu.push({ label: `${x.user.tag}`, description: `Sunucuya katÄ±lÄ±m: ${tarihsel(x.joinedTimestamp)}`, value: `${x.id}` }))
    const yoneticilermenusu = new ActionRowBuilder()
      .addComponents(
        new StringSelectMenuBuilder()
          .setCustomId("yoneticiMenu")
          .setPlaceholder("YÃ¶neticiler")
          .setOptions(adminmenu)
      );
    var guardData = await guard.findOne({ guildID: message.guild.id })
    var databaseOnly = guardData ? guardData.database : false
    var serverGuardOnly = guardData ? guardData.serverGuard : false
    var roleGuardOnly = guardData ? guardData.rolesGuard : false
    var channelGuardOnly = guardData ? guardData.channelsGuard : false
    var bankickGuardOnly = guardData ? guardData.banKickGuard : false
    var emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
    var urlSpammerOnly = guardData ? guardData.UrlSpammer : false
    var webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
    var chatGuardOnly = guardData ? guardData.chatGuards : false
    message.channel.send({
      embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
        ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
        ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
        ${guardEmoji} Database verilerini tekrar yedekleyebilir,
        ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin.
        ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
        ${Formatters.codeBlock("md",
        `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
        `)}
        **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
        `)], components: [ayarbutonlarÄ±, ayaryedekleme, ayarbutonlarÄ±2, yoneticilermenusu]
    }).then(async msg => {
      const filter = d => d.user.id == message.member.id
      const collector = msg.createMessageComponentCollector({ filter: filter, errors: ["time"], time: 30000 * 10 })
      collector.on('collect', async (interaction) => {
        await interaction.deferUpdate();
        if (interaction.customId == "weboffline") {
          webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
          if (webandofflineOnly == true) {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { webAndofflineGuard: false } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            databaseOnly = guardData ? guardData.database : false
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
              ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
              ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
              ${guardEmoji} Database verilerini tekrar yedekleyebilir,
              ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
              ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
              ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
              `)}
                      **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
              `)]
            })
          } else {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { webAndofflineGuard: true } }, { upsert: true })

            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            databaseOnly = guardData ? guardData.database : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
              ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
              ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
              ${guardEmoji} Database verilerini tekrar yedekleyebilir,
              ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
              ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
              ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
              `)}
                      **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
              `)]
            })
          }
        }
        if (interaction.customId == "kanalyedek") {
          guardData = await guard.findOne({ guildID: interaction.guild.id })
          databaseOnly = guardData ? guardData.database : false
          if (databaseOnly == true) {
            await guildChannels(interaction.guild)
            await guildRoles(interaction.guild)
            await interaction.channel.send({ content: `**Kanallar ve Roller BaÅŸarÄ±yla Yedeklendi!**`, ephemeral: true })
          }
          else {
            await interaction.channel.send({ content: `**Datebase Sistemi** kapalÄ± olduÄŸundan dolayÄ± yedekleme iÅŸlemi yapÄ±lamaz.`, ephemeral: true })
          }
        }
        if (interaction.customId == "database") {
          databaseOnly = guardData ? guardData.database : false

          if (databaseOnly == true) {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { database: false } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            databaseOnly = guardData ? guardData.database : false
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          } else {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { database: true } }, { upsert: true })

            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            databaseOnly = guardData ? guardData.database : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
            await guildRoles(interaction.guild)
            await guildChannels(interaction.guild)
            await interaction.channel.send({ content: `**Roller ve Kanallar Yedeklendi!** \n\`Not: Tekrar Yedeklemek iÃ§in "KanallarÄ± Yedekle" & "Rolleri Yedekle" butonlarÄ±nÄ± kullanabilirsiniz.\``, ephemeral: true })

          }
        }
        if (interaction.customId == "sunucuayarkoruma") {
          serverGuardOnly = guardData ? guardData.serverGuard : false

          if (serverGuardOnly == true) {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { serverGuard: false } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            databaseOnly = guardData ? guardData.database : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          } else {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { serverGuard: true } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          }
        }
        if (interaction.customId == "rolkoruma") {
          roleGuardOnly = guardData ? guardData.rolesGuard : false

          if (roleGuardOnly == true) {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { rolesGuard: false } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          } else {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { rolesGuard: true } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          }
        }
        if (interaction.customId == "kanalkoruma") {
          channelGuardOnly = guardData ? guardData.channelsGuard : false

          if (channelGuardOnly == true) {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { channelsGuard: false } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            databaseOnly = guardData ? guardData.database : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          } else {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { channelsGuard: true } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          }
        }
        if (interaction.customId == "bankickkoruma") {
          bankickGuardOnly = guardData ? guardData.banKickGuard : false

          if (bankickGuardOnly == true) {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { banKickGuard: false } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          } else {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { banKickGuard: true } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          }
        }
        if (interaction.customId == "emojistickerskoruma") {
          emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false

          if (emojistickerGuardOnly == true) {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { emojiStickersGuard: false } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            databaseOnly = guardData ? guardData.database : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          } else {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { emojiStickersGuard: true } }, { upsert: true })

            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          }
        }
        if (interaction.customId == "chatguard") {
          chatGuardOnly = guardData ? guardData.chatGuards : false

          if (chatGuardOnly == true) {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { chatGuards: false } }, { upsert: true })
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            databaseOnly = guardData ? guardData.database : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            chatGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}  
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          } else {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { chatGuards: true } }, { upsert: true })

            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${guardData?.chatGuards ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          }
        }
        if (interaction.customId == "urlspammer") {
          if (!message.guild.vanityURLCode || message.guild.vanityURLCode == null) return interaction.channel.send({ content: `Ã–zel URL'ye sahip olmadÄ±ÄŸÄ±nÄ±z iÃ§in bu sistemi kullanamazsÄ±nÄ±z.` })
          urlSpammerOnly = guardData ? guardData.UrlSpammer : false
          webandofflineOnly = guardData ? guardData.webAndofflineGuard : false

          if (urlSpammerOnly == true) {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { UrlSpammer: false } }, { upsert: true })
            exec('pm2 stop ../../../../../Ertu-Guard/UrlSpammer/approval.js', (error, stdout, stderr) => {
              if (error) {
                console.error(`Bir hata oluÅŸtu: ${error}`);
                return;
              }

              console.log(`Ã‡Ä±ktÄ±: ${stdout}`);
              console.error(`Hata: ${stderr}`);
            }); guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            databaseOnly = guardData ? guardData.database : false
            chatGuardOnly = guardData ? guardData.chatGuards : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          } else {
            await guard.findOneAndUpdate({ guildID: interaction.guild.id }, { $set: { UrlSpammer: true } }, { upsert: true })
            exec('pm2 start  ../../../../../Ertu-Guard/UrlSpammer/approval.js', (error, stdout, stderr) => {
              if (error) {
                console.error(`Bir hata oluÅŸtu: ${error}`);
                return;
              }
              console.log(`Ã‡Ä±ktÄ±: ${stdout}`);
              console.error(`Hata: ${stderr}`);
            });
            guardData = await guard.findOne({ guildID: interaction.guild.id })
            serverGuardOnly = guardData ? guardData.serverGuard : false
            roleGuardOnly = guardData ? guardData.rolesGuard : false
            channelGuardOnly = guardData ? guardData.channelsGuard : false
            bankickGuardOnly = guardData ? guardData.banKickGuard : false
            emojistickerGuardOnly = guardData ? guardData.emojiStickersGuard : false
            urlSpammerOnly = guardData ? guardData.UrlSpammer : false
            chatGuardOnly = guardData ? guardData.chatGuards : false

            webandofflineOnly = guardData ? guardData.webAndofflineGuard : false
            await msg.edit({
              embeds: [ertuembed.setDescription(`Merhaba ${message.member} Guard YÃ¶netim ve Kontrol Paneline HoÅŸgeldin,
            ${guardEmoji} AÅŸaÄŸÄ±da bulunan butonlardan korumalarÄ± aÃ§Ä±p/kapatabilir,
            ${guardEmoji} MenÃ¼den bulunan yÃ¶neticileri GÃ¼venliye ekleyebilir/Ã§Ä±karabilir,
            ${guardEmoji} Database verilerini tekrar yedekleyebilir,
            ${guardEmoji} Yetkileri aÃ§Ä±p/kapatabilirsin
            ${guardEmoji} URL Spammer ile Url'ni koruyabilirsin.\n\`Spamlama iÅŸlemi 1 dakika arayla yapÄ±lmaktadÄ±r.\`
            ${Formatters.codeBlock("md",
                `# Sunucu Koruma Paneli
${databaseOnly == true ? "< Database                 : AÃ§Ä±k ğŸŸ¢" : "> Database                 : KapalÄ± ğŸ”´"}
${urlSpammerOnly == true ? "< URL Spammer              : AÃ§Ä±k ğŸŸ¢" : "> URL Spammer              : KapalÄ± ğŸ”´"}
${roleGuardOnly == true ? "< Rol KorumasÄ±             : AÃ§Ä±k ğŸŸ¢" : "> Rol KorumasÄ±             : KapalÄ± ğŸ”´"}
${channelGuardOnly == true ? "< Kanal KorumasÄ±           : AÃ§Ä±k ğŸŸ¢" : "> Kanal KorumasÄ±           : KapalÄ± ğŸ”´"}
${serverGuardOnly == true ? "< Sunucu KorumasÄ±          : AÃ§Ä±k ğŸŸ¢" : "> Sunucu KorumasÄ±          : KapalÄ± ğŸ”´"}
${bankickGuardOnly == true ? "< Ban ve Kick KorumasÄ±     : AÃ§Ä±k ğŸŸ¢" : "> Ban ve Kick KorumasÄ±     : KapalÄ± ğŸ”´"}
${emojistickerGuardOnly == true ? "< Emoji ve Sticker KorumasÄ±: AÃ§Ä±k ğŸŸ¢" : "> Emoji ve Sticker KorumasÄ±: KapalÄ± ğŸ”´"}
${webandofflineOnly == true ? "< Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : AÃ§Ä±k ğŸŸ¢" : "> Web/Ã‡evrimdÄ±ÅŸÄ± KorumasÄ±  : KapalÄ± ğŸ”´"}
${chatGuardOnly == true ? "< Chat Guard KorumasÄ±      : AÃ§Ä±k ğŸŸ¢" : "> Chat Guard KorumasÄ±      : KapalÄ± ğŸ”´"}
            `)}
                    **[Unutma]** \`Not:\` __Bu panele sadece__ **TaÃ§ Sahibi <@${message.guild.ownerId}>** __ ve ${ertucuk.BotsOwners.map(x => `<@${x}>`).join(", ")} eriÅŸebilir ve kullanabilir.__
            `)]
            })
          }
        }
        if (interaction.customId == "yetkiac") {
          interaction.channel.send({
            embeds: [
              new EmbedBuilder()
                .setDescription(`Sunucuda bulunan rollerde ki yetkileri aÃ§mak veya kapatmak iÃ§in aÅŸaÄŸÄ±da ki butonlarÄ± kullanÄ±nÄ±z!`)
            ],
            components: [
              new ActionRowBuilder()
                .setComponents(
                  new ButtonBuilder().setCustomId("ac").setLabel("Yetkileri AÃ§").setStyle(ButtonStyle.Danger),
                  new ButtonBuilder().setCustomId("kapat").setLabel("Yetkileri Kapat").setStyle(ButtonStyle.Success)
                )
            ]
          })
            .then(async ytMSG => {
              const filter = d => d.user.id == message.member.id
              const collector = ytMSG.createMessageComponentCollector({ filter: filter, errors: ["time"], time: 30000 * 10 })
              collector.on('collect', async (ytInteraction) => {
                await ytInteraction.deferUpdate();
                if (ytInteraction.customId == "ac") {
                  let rolepData = await rolePermissions.find();
                  if (!rolepData || rolepData.length == 0) return ytInteraction.channel.send({ content: `Veri bulunamadÄ±!` });
                  rolepData.forEach(async data => {
                    let role = ytInteraction.guild.roles.cache.get(data.roleID);
                    if (!role) return;
                    if (!role.editable) return;
                    role.setPermissions(new PermissionsBitField(data.BitField))
                    ytInteraction.channel.send({
                      embeds: [
                        new EmbedBuilder().setDescription(`\`${role.name}\` isimli role **${data.BitField}** yetkisi verildi!`)
                      ]
                    })
                    await guardPenalty.findOneAndUpdate({ guildID: message.guild.id, OrusbuEvladÄ±: message.member.id }, { $push: { iÅŸlemler: { GÃ¼venilir: safedMembers.some(id => id == message.member.id), iÅŸlem: `${role.name} ${data.BitField} âœ…`, Tarih: Date.now() } } }, { upsert: true })
                    await rolePermissions.findOneAndDelete({ roleID: role.id }, { upsert: true })
                  })

                }
                if (ytInteraction.customId == "kapat") {
                  let roles = ytInteraction.guild.roles.cache.filter(r => r.editable && (r.permissions.has(PermissionsBitField.Flags.Administrator) || r.permissions.has(PermissionsBitField.Flags.ManageGuild) || r.permissions.has(PermissionsBitField.Flags.ManageRoles) || r.permissions.has(PermissionsBitField.Flags.ManageWebhooks) || r.permissions.has(PermissionsBitField.Flags.BanMembers) || r.permissions.has(PermissionsBitField.Flags.KickMembers) || r.permissions.has(PermissionsBitField.Flags.ModerateMembers)))
                  if (roles.size == 0) return ytInteraction.channel.send({
                    embeds: [
                      new EmbedBuilder()
                        .setDescription(`Sunucuda yetkisi kapatÄ±lÄ±cak rol bulunamadÄ± veya yetersiz yetkim bulunuyor.`)
                    ]
                  })
                  ytInteraction.guild.roles.cache.filter(r => r.editable && (r.permissions.has(PermissionsBitField.Flags.Administrator) || r.permissions.has(PermissionsBitField.Flags.ManageGuild) || r.permissions.has(PermissionsBitField.Flags.ManageRoles) || r.permissions.has(PermissionsBitField.Flags.ManageWebhooks) || r.permissions.has(PermissionsBitField.Flags.BanMembers) || r.permissions.has(PermissionsBitField.Flags.KickMembers) || r.permissions.has(PermissionsBitField.Flags.ModerateMembers))).forEach(async r => {
                    await r.setPermissions(PermissionsBitField.Flags.SendMessages);
                  });
                  ytInteraction.channel.send({
                    embeds: [
                      new EmbedBuilder()
                        .setDescription(`AÅŸaÄŸÄ±daki rollerin yetkileri kapatÄ±lmÄ±ÅŸtÄ±r.`)
                        .setFields({ name: `Roller \`(${roles.size})\``, value: `${roles.map(x => `\`${x.rawPosition}.\` **> ${x.name} [~~${x.permissions.bitfield}~~]**`).join("\n")}` })
                    ]
                  })
                  await guardPenalty.findOneAndUpdate({ guildID: message.guild.id, OrusbuEvladÄ±: message.member.id }, { $push: { iÅŸlemler: { GÃ¼venilir: safedMembers.some(id => id == message.member.id), iÅŸlem: `${role.name} ${data.BitField} â�Œ`, Tarih: Date.now() } } }, { upsert: true })

                }
              })
            })
        }
        for (let index = 0; index < adminmenu.length; index++) {
          const element = adminmenu[index];
          if (interaction.values && interaction.values[0] == element.value) {
            let admin = interaction.guild.members.cache.get(element.value)
            let guardp = await guardPenalty.findOne({ OrusbuEvladÄ±: admin.id });
            let guardsicil = guardp ? guardp.iÅŸlemler : [];
            let adminembed = new EmbedBuilder().setAuthor({ name: admin.user.tag, iconURL: admin.user.avatarURL() })
              .setDescription(`<t:${(admin.joinedTimestamp / 1000).toFixed()}> Tarihinden beri sunucuda bulunuyor.`)
              .addFields({
                name: `ğŸ‘¤ KullanÄ±cÄ± Bilgisi`, value: `
        \`${guardEmoji}\` ID: \`${admin.id}\`
        \`${guardEmoji}\` Profil: ${admin}`, inline: true
              })
            if (guardsicil.length > 0) {
              adminembed.addFields({ name: "Son 10 Ä°ÅŸlemi", value: `**${guardsicil.sort((a, b) => b.Tarih - a.Tarih).map(x => `[${x.GÃ¼venilir == true ? "âœ…" : "â�Œ"} | <t:${(x.Tarih / 1000).toFixed()}>] ${x.iÅŸlem} `).splice(0, 10).join("\n")}**` })
            }

            interaction.channel.send({
              embeds: [
                adminembed
              ]
            })
          }
        }

      })
    })


  },

};