const Discord = require("discord.js");

module.exports = {
  interaction: {
    name: "komutlar",
    description: "TÃ¼m komutlarÄ±, kategorileriyle birlikte listeler.",
    options: [
      {
        name: "komut",
        description: "BelirttiÄŸiniz komut hakkÄ±nda bilgi verir.",
        type: 3,
        required: false
      },
    ]
  },
  aliases: ['h', 'help', 'y', 'yardÄ±m', 'yardim', 'komut', 'commands', 'cmds'],
  category: "Bot",
  memberPermissions: [],
  botPermissions: ["SendMessages", "EmbedLinks", "ReadMessageHistory"],
  nsfw: false,
  cooldown: 10000,
  ownerOnly: false,

  async execute(client, interaction, data, args) {

    //------------------------------KOMUT BÄ°LGÄ°------------------------------//

    let commandArgs = interaction.type === 2 ? interaction.options.getString("komut") : args.slice(0).join(" ");

    if (commandArgs) {

      let selectedCmd = client.commands.filter(command => command.category && command.category !== "Developer")
        .find(cmd => (cmd.interaction || cmd).name === commandArgs || cmd.aliases?.includes(commandArgs));

      if (selectedCmd) {

        return interaction.reply({
          embeds: [
            {
              color: client.settings.embedColors.default,
              //title: '**Â»** Botun davet baÄŸlantÄ±sÄ±na ulaÅŸmak iÃ§in buraya tÄ±kla!',
              author: {
                name: `${client.user.username} â€¢ Komut Bilgisi`,
                icon_url: client.settings.icon,
              },
              fields: [
                {
                  name: '**Â»** Komut',
                  value: `**â€¢** ${client.capitalizeFirstLetter(selectedCmd.interaction ? selectedCmd.interaction.name : selectedCmd.name, "tr")}`,
                },
                {
                  name: '**Â»** AÃ§Ä±klama',
                  value: `**â€¢** ${selectedCmd.interaction ? selectedCmd.interaction.description : selectedCmd.description}`,
                },
                {
                  name: '**Â»** Kategori',
                  value: `**â€¢** ${selectedCmd.category}`,
                },
              ],
            }
          ],
        });

      } else {

        return interaction.reply({
          embeds: [
            {
              color: client.settings.embedColors.red,
              title: "**Â»** Komut BulunamadÄ±!",
              description: `**â€¢** TÃ¼m komutlarÄ± gÃ¶rmek iÃ§in \`/komutlar\` yazabilirsin.`
            }
          ],
        });

      }

    }

    //------------------------------KOMUT BÄ°LGÄ°------------------------------//

    //------------------------------Embeds------------------------------//

    let fieldsLinks = {
      name: '**Â»** BaÄŸlantÄ±lar',
      value: `**â€¢** [Destek Sunucusu](https://discord.gg/VppTU9h) â€¢ [Davet BaÄŸlantÄ±sÄ±](${client.settings.invite})`,
      inline: false
    };

    //Yetkili KomutlarÄ±
    let embedModeration = { fields: [] };
    let commandsModeration = [];
    await client.commands.forEach(command => {
      if (command.category == 'Moderation') {
        if (!command.interaction) {
          commandsModeration.push(`**â€¢** \`${data.prefix}${command.name}\` - ${command.description}\n`);
        } else {
          if (command.interaction.type && command.interaction.type == 3) {
            commandsModeration.push(`**â€¢** \`${command.interaction.name}\` - (Uygulama)\n`);
          } else if ((command.interaction.options && command.interaction.options.length > 0) && (command.interaction.options[0].type == 1 || command.interaction.options[0].type == 2) && command.interaction.name !== "prefix") {
            let options = [];
            command.interaction.options.forEach(subCommand => {
              options.push(`**â€¢** \`/${command.interaction.name} ${subCommand.name}\``);
            });
            if (command.interaction.name === "davet-sistemi")
              options.push(`**â€¢** \`/davetler\``);
            embedModeration.fields.push({
              name:
                `**Â»** ${command.interaction.name.replace(/-/g, " ").toLowerCase().replace(/^[\u00C0-\u1FFF\u2C00-\uD7FF\w]|\s[\u00C0-\u1FFF\u2C00-\uD7FF\w]/g, function (letter) {
                  return letter.toUpperCase();
                })}`,
              value: options.join('\n'),
              inline: true
            });
          } else {
            commandsModeration.push(`**â€¢** \`/${command.interaction.name}\` - ${command.interaction.description}\n`);
          }
        }
      }
    });
    embedModeration.fields = embedModeration.fields.sort(function (a, b) { return b.value.split(/\r\n|\r|\n/).length - a.value.split(/\r\n|\r|\n/).length; });
    embedModeration.color = client.settings.embedColors.default;
    embedModeration.author = {
      name: `${client.user.username} â€¢ Yetkili KomutlarÄ±`,
      icon_url: client.settings.icon,
    };
    embedModeration.title = `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`;
    embedModeration.description = commandsModeration.join('');
    embedModeration.fields.push({
      name: "**Â»** Bilgi âš ï¸�",
      value:
        `**â€¢** Bu bot Nraphy aÃ§Ä±k kaynak altyapÄ±sÄ± kullanÄ±larak oluÅŸturulmuÅŸtur.\n` +
        `**â€¢** AÃ§Ä±k kaynak altyapÄ±sÄ±nda bazÄ± sistemler ve komutlar mevcut deÄŸildir.\n` +
        `**â€¢** TÃ¼m sistemler ve daha fazlasÄ± ResmÃ® Nraphy botunda mevcuttur.\n` +
        `**â€¢** [Nraphy'i sunucuna eklemek iÃ§in buraya tÄ±kla!](https://top.gg/bot/700959962452459550/)`,
    });
    embedModeration.fields.push(fieldsLinks);
    embedModeration.fields.unshift({
      name: '**Â»** Mesaj Filtreleme Sistemleri',
      value:
        `**â€¢** Bu komutlar farklÄ± bir sayfaya taÅŸÄ±nmÄ±ÅŸtÄ±r.\n` +
        `**â€¢** \`BaÄŸlantÄ± Engel, BÃ¼yÃ¼k Harf Engel, Etiket SÄ±nÄ±rlama, Spam KorumasÄ±\``,
      inline: false
    });

    //Mesaj Filtreleme Sistemleri - Embed
    let embedMessageFilters = {
      color: client.settings.embedColors.default,
      author: {
        name: `${client.user.username} â€¢ Mesaj Filtreleme Sistemleri`,
        icon_url: client.settings.icon,
      },
      title: `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`,
      description:
        `**â€¢** Bu bot Nraphy aÃ§Ä±k kaynak altyapÄ±sÄ± kullanÄ±larak oluÅŸturulmuÅŸtur.\n` +
        `**â€¢** AÃ§Ä±k kaynak altyapÄ±sÄ±nda Etiket SÄ±nÄ±rlama sistemi mevcut deÄŸildir.\n` +
        `**â€¢** Etiket SÄ±nÄ±rlama sistemi ve daha fazlasÄ± ResmÃ® Nraphy botunda mevcuttur.\n` +
        `**â€¢** [Nraphy'i sunucuna eklemek iÃ§in buraya tÄ±kla!](https://top.gg/bot/700959962452459550/)`,
      fields: [
        ...(client.commands.filter(command => command.category === "MessageFilters").map(command => ({
          name: `**Â»** ${command.interaction.name.replace(/-/g, " ").toLowerCase().replace(/^[\u00C0-\u1FFF\u2C00-\uD7FF\w]|\s[\u00C0-\u1FFF\u2C00-\uD7FF\w]/g, function (letter) {
            return letter.toUpperCase();
          })}`,
          value:
            `**â€¢** ${command.interaction.description}\n` +
            command.interaction.options.map(option => `**â€¢** \`/${command.interaction.name} ${option.name}\``).join('\n'),
          inline: false
        }))),
        fieldsLinks
      ],
    };

    //EÄŸlence KomutlarÄ±
    let commandsFun = [];
    client.commands.forEach(command => {
      if (command.category == 'Fun') {
        if (!command.interaction) {
          commandsFun.push(`**â€¢** \`${data.prefix}${command.name}\` - ${command.description}\n`);
        } else {
          if (command.interaction.type && command.interaction.type == 3) {
            commandsFun.push(`**â€¢** \`${command.interaction.name}\` - (Uygulama)\n`);
          } else if ((command.interaction.options && command.interaction.options.length > 0) && (command.interaction.options[0].type == 1 || command.interaction.options[0].type == 2)) {
            command.interaction.options.forEach(subCommand => {
              commandsFun.push(`**â€¢** \`/${command.interaction.name + " " + subCommand.name}\` - ${subCommand.description}\n`);
            });
          } else {
            commandsFun.push(`**â€¢** \`/${command.interaction.name}\` - ${command.interaction.description}\n`);
          }
        }
      }
    });
    let embedFun = {
      color: client.settings.embedColors.default,
      author: {
        name: `${client.user.username} â€¢ EÄŸlence KomutlarÄ±`,
        icon_url: client.settings.icon,
      },
      title: `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`,
      description: commandsFun.join(''),
      fields: [fieldsLinks],
    };

    //Genel Komutlar
    let commandsGeneral = [];
    client.commands.forEach(command => {
      if (command.category == 'General') {
        if (!command.interaction) {
          commandsGeneral.push(`**â€¢** \`${data.prefix}${command.name}\` - ${command.description}\n`);
        } else {
          if (command.interaction.type && command.interaction.type == 3) {
            commandsGeneral.push(`**â€¢** \`${command.interaction.name}\` - (Uygulama)\n`);
          } else if ((command.interaction.options && command.interaction.options.length > 0) && (command.interaction.options[0].type == 1 || command.interaction.options[0].type == 2)) {
            command.interaction.options.forEach(subCommand => {
              commandsGeneral.push(`**â€¢** \`/${command.interaction.name + " " + subCommand.name}\` - ${subCommand.description}\n`);
            });
          } else {
            commandsGeneral.push(`**â€¢** \`/${command.interaction.name}\` - ${command.interaction.description}\n`);
          }
        }
      }
    });
    let embedGeneral = {
      color: client.settings.embedColors.default,
      author: {
        name: `${client.user.username} â€¢ Genel Komutlar`,
        icon_url: client.settings.icon,
      },
      title: `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`,
      description: commandsGeneral.join(''),
      fields: [fieldsLinks],
    };

    //Oyunlar
    let embedGames = { fields: [] };
    let commandsGames = [];
    await client.commands.forEach(command => {
      if (command.category == 'Games') {
        if (!command.interaction) {
          commandsGames.push(`**â€¢** \`${data.prefix}${command.name}\` - ${command.description}\n`);
        } else {
          if (command.interaction.type && command.interaction.type == 3) {
            commandsGames.push(`**â€¢** \`${command.interaction.name}\` - (Uygulama)\n`);
          } else if ((command.interaction.options && command.interaction.options.length > 0) && (command.interaction.options[0].type == 1 || command.interaction.options[0].type == 2)) {
            let options = [];
            command.interaction.options.forEach(subCommand => {
              options.push(`**â€¢** \`/${command.interaction.name + " " + subCommand.name}\``);
            });
            //embedGames.fields.push(`**Â»** ${client.capitalizeFirstLetter(command.interaction.name, "tr")}`, options.join('\n'), true);
            embedGames.fields.push({
              name:
                `**Â»** ${command.interaction.name.replace(/-/g, " ").toLowerCase().replace(/^[\u00C0-\u1FFF\u2C00-\uD7FF\w]|\s[\u00C0-\u1FFF\u2C00-\uD7FF\w]/g, function (letter) {
                  return letter.toUpperCase();
                })}`,
              value: options.join('\n'),
              inline: true
            });
          } else {
            commandsGames.push(`**â€¢** \`/${command.interaction.name}\` - ${command.interaction.description}\n`);
          }
        }
      }
    });
    embedGames.color = client.settings.embedColors.default;
    embedGames.author = {
      name: `${client.user.username} â€¢ Oyunlar`,
      icon_url: client.settings.icon,
    };
    embedGames.title = `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`;
    embedGames.description = commandsGames.join('');
    embedGames.fields.push({
      name: "**Â»** Bilgi âš ï¸�",
      value:
        `**â€¢** Bu bot Nraphy aÃ§Ä±k kaynak altyapÄ±sÄ± kullanÄ±larak oluÅŸturulmuÅŸtur.\n` +
        `**â€¢** AÃ§Ä±k kaynak altyapÄ±sÄ±nda bazÄ± sistemler ve komutlar mevcut deÄŸildir.\n` +
        `**â€¢** TÃ¼m sistemler ve daha fazlasÄ± ResmÃ® Nraphy botunda mevcuttur.\n` +
        `**â€¢** [Nraphy'i sunucuna eklemek iÃ§in buraya tÄ±kla!](https://top.gg/bot/700959962452459550/)`,
    });
    embedGames.fields.push(fieldsLinks);

    //MÃ¼zik KomutlarÄ±
    let embedMusic = {
      color: client.settings.embedColors.default,
      author: {
        name: `${client.user.username} â€¢ MÃ¼zik KomutlarÄ±`,
        icon_url: client.settings.icon,
      },
      title: `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`,
      fields: [
        {
          name: '**Â»** Å�arkÄ± BaÅŸlatma',
          value:
            client.commands
              .filter(command => command.category == 'Music_Player')
              .map(command => `**â€¢** \`/${command.interaction.name}\` - ${command.interaction.description}`)
              .join('\n'),
          inline: false
        },
        {
          name: '**Â»** OynatÄ±cÄ± FonksiyonlarÄ±',
          value:
            [
              {
                interaction: { name: "durdur - /yÃ¼rÃ¼t", description: "Ã‡alan ÅŸarkÄ±yÄ± duraklatÄ±r/devam ettirir.", },
                category: "Music"
              },
              ...Array.from(client.commands.filter(command => command.category == 'Music' && !['durdur', 'yÃ¼rÃ¼t'].includes(command.interaction.name)), ([key, value]) => (value))
            ]
              .map(command => `**â€¢** \`/${command.interaction.name}\` - ${command.interaction.description}`)
              .sort()
              .join('\n'),
          inline: false
        },
        fieldsLinks
      ],
    };

    //Ã‡ekiliÅŸ KomutlarÄ±
    let embedGiveaway = {
      color: client.settings.embedColors.default,
      author: {
        name: `${client.user.username} â€¢ Ã‡ekiliÅŸ`,
        icon_url: client.settings.icon,
      },
      title: `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`,
      description:
        `**â€¢** Bu bot Nraphy aÃ§Ä±k kaynak altyapÄ±sÄ± kullanÄ±larak oluÅŸturulmuÅŸtur.\n` +
        `**â€¢** AÃ§Ä±k kaynak altyapÄ±sÄ±nda Ã‡ekiliÅŸ komutlarÄ± mevcut deÄŸildir.\n` +
        `**â€¢** Ã‡ekiliÅŸ komutlarÄ± ve daha fazlasÄ± ResmÃ® Nraphy botunda mevcuttur.\n` +
        `**â€¢** [Nraphy'i sunucuna eklemek iÃ§in buraya tÄ±kla!](https://top.gg/bot/700959962452459550/)`,
      fields: [fieldsLinks],
    };

    //NraphyCoin
    let embedNC = {
      color: client.settings.embedColors.default,
      author: {
        name: `${client.user.username} â€¢ NraphyCoin`,
        icon_url: client.settings.icon,
      },
      title: `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`,
      description:
        `**â€¢** Bu bot Nraphy aÃ§Ä±k kaynak altyapÄ±sÄ± kullanÄ±larak oluÅŸturulmuÅŸtur.\n` +
        `**â€¢** AÃ§Ä±k kaynak altyapÄ±sÄ±nda NraphyCoin komutlarÄ± mevcut deÄŸildir.\n` +
        `**â€¢** NraphyCoin komutlarÄ± ve daha fazlasÄ± ResmÃ® Nraphy botunda mevcuttur.\n` +
        `**â€¢** [Nraphy'i sunucuna eklemek iÃ§in buraya tÄ±kla!](https://top.gg/bot/700959962452459550/)`,
      fields: [fieldsLinks],
    };

    //Botla Ä°lgili Komutlar
    /* let commandsBot = [];
    client.commands.forEach(command => {
      if (command.category == 'Bot') {
        if (!command.interaction) {
          commandsBot.push(`**â€¢** \`${data.prefix}${command.name}\` - ${command.description}\n`);
        } else {
          if (command.interaction.type && command.interaction.type == 3) {
            commandsBot.push(`**â€¢** \`${command.interaction.name}\` - (Uygulama)\n`);
          } else if ((command.interaction.options && command.interaction.options.length > 0) && (command.interaction.options[0].type == 1 || command.interaction.options[0].type == 2)) {
            command.interaction.options.forEach(subCommand => {
              commandsBot.push(`**â€¢** \`/${command.interaction.name + " " + subCommand.name}\` - ${subCommand.description}\n`);
            });
          } else {
            commandsBot.push(`**â€¢** \`/${command.interaction.name}\` - ${command.interaction.description}\n`);
          }
        }
      }
    }); */
    let embedBot = {
      color: client.settings.embedColors.default,
      author: {
        name: `${client.user.username} â€¢ Botla Ä°lgili Komutlar`,
        icon_url: client.settings.icon,
      },
      title: `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`,
      description: client.commands
        .filter(command => command.category == 'Bot')
        .map(command => (command.interaction.options[0]?.type == 1 || command.interaction.options[0]?.type == 2)
          ? command.interaction.options.map(option => `**â€¢** \`/${command.interaction.name} ${option.name}\` - ${option.description}`).join('\n')
          : `**â€¢** \`/${command.interaction.name}\` - ${command.interaction.description}`)
        .join('\n'),
      fields: [fieldsLinks],
    };

    //Ana Sayfa - Embed
    const embedMainPage = {
      color: client.settings.embedColors.default,
      title: `Bir komut hakkÄ±nda bilgi almak iÃ§in \`/komutlar <Komut>\` yazabilirsiniz.`,
      author: {
        name: `${client.user.username} â€¢ Komutlar`,
        icon_url: client.settings.icon
      },
      description:
        `AÅŸaÄŸÄ±daki menÃ¼den istediÄŸiniz kategorinin komutlarÄ±na ulaÅŸabilirsiniz.\n\n` +

        `ğŸ“š â€¢ Ana Sayfa\n\n` +

        `ğŸ“˜ â€¢ Yetkili KomutlarÄ± (**${commandsModeration.length + embedModeration.fields.length - 2}**)\n` +
        `â†³ Mesaj Filtreleme Sistemleri (**${embedMessageFilters.fields.length - 1}**)\n` +
        `ğŸ“™ â€¢ EÄŸlence KomutlarÄ± (**${commandsFun.length}**)\n` +
        `ğŸ“— â€¢ Genel Komutlar (**${commandsGeneral.length}**)\n` +
        `ğŸ“• â€¢ Oyunlar (**${commandsGames.length + embedGames.fields.length - 1}**)\n` +
        `ğŸ�µ â€¢ MÃ¼zik KomutlarÄ± (**${client.commands.filter(command => command.category?.startsWith('Music')).size}**)\n` +
        `ğŸ�‰ â€¢ Ã‡ekiliÅŸ (ğŸ”’)\n` +
        `ğŸ’° â€¢ NraphyCoin (ğŸ”’)\n` +
        `ğŸ¤– â€¢ Botla Ä°lgili Komutlar (**${client.commands.filter(command => command.category?.startsWith('Bot')).size}**)\n\n` +

        `Bu bot [Nraphy AÃ§Ä±k Kaynak Projesi](https://github.com/RFKaya/Nraphy/) ile oluÅŸturulmuÅŸtur.\n` +
        `Bu botun nihai sÃ¼rÃ¼mÃ¼ yalnÄ±zca ResmÃ® Nraphy botunda mevcuttur.`
        /*`${(data.user.readDateOfChanges < client.settings.updateDate) ?
          `âœ‰ï¸� OkunmamÄ±ÅŸ yenilikler mevcut! \`/yenilikler\` yazarak okuyabilirsin!` :
          `GeliÅŸmelerden haberdar olmak iÃ§in destek sunucumuza katÄ±labilirsiniz!`}`*/,
      fields: [fieldsLinks],
    };

    //Row
    const row = new Discord.ActionRowBuilder()
      .addComponents(
        new Discord.StringSelectMenuBuilder()
          .setCustomId('select')
          .setPlaceholder('Buradan kategori seÃ§ebilirsin')
          .addOptions([
            {
              label: 'Ana Sayfa',
              emoji: 'ğŸ“š',
              description: 'KomutlarÄ±n kategorilerini listeleyen sayfa.',
              value: 'mainPageOption',
            },
            {
              label: 'Yetkili KomutlarÄ±',
              emoji: 'ğŸ“˜',
              description: 'Sunucuyla ilgili yÃ¶netim komutlarÄ±.',
              value: 'moderationOption',
            },
            {
              label: 'â†³ Mesaj Filtreleme Sistemleri',
              //emoji: 'ğŸ“˜',
              description: 'BaÄŸlantÄ± Engel, Spam KorumasÄ± vb.',
              value: 'messageFiltersOption',
            },
            {
              label: 'EÄŸlence KomutlarÄ±',
              emoji: 'ğŸ“™',
              description: 'Espri, AÅŸk-Ã–lÃ§er, KonuÅŸtur, 144p gibi eÄŸlenceli komutlar.',
              value: 'funOption',
            },
            {
              label: 'Genel KomutlarÄ±',
              emoji: 'ğŸ“—',
              description: 'Ä°ÅŸinize yarayabilecek komutlar.',
              value: 'generalOption',
            },
            {
              label: 'Oyunlar',
              emoji: 'ğŸ“•',
              description: 'DÃ¼ello, XOX, YazÄ±-Tura, Kelime-YarÄ±ÅŸmasÄ± gibi oyunlar.',
              value: 'gamesOption',
            },
            {
              label: 'MÃ¼zik KomutlarÄ±',
              emoji: 'ğŸ�µ',
              //description: 'MÃ¼zik Ã§almanÄ±za yarayan komutlar.',
              value: 'musicOption',
            },
            {
              label: 'Ã‡ekiliÅŸ KomutlarÄ±',
              emoji: 'ğŸ�‰',
              //description: 'Ã‡ekiliÅŸ yapmanÄ±za yarayan komutlar.',
              value: 'giveawayOption',
            },
            {
              label: 'NraphyCoin KomutlarÄ±',
              emoji: 'ğŸ’°',
              //description: 'NraphyCoin ile ilgili tÃ¼m komutlar.',
              value: 'NCOption',
            },
            {
              label: 'Bot KomutlarÄ±',
              emoji: 'ğŸ¤–',
              description: 'Nraphy ile ilgili komutlar.',
              value: 'botOption',
            },
          ])
      );

    //------------------------------Embeds------------------------------//

    //------------------------------Sending Embed & Select Menu------------------------------//

    interaction.reply({
      embeds: [embedMainPage],
      components: [row]
    }).then(async msg => {

      const embedMaps = {
        "mainPageOption": embedMainPage,
        "moderationOption": embedModeration,
        "messageFiltersOption": embedMessageFilters,
        "funOption": embedFun,
        "generalOption": embedGeneral,
        "gamesOption": embedGames,
        "NCOption": embedNC,
        "botOption": embedBot,
        "musicOption": embedMusic,
        "giveawayOption": embedGiveaway,
      };

      const reply = interaction.type === 2 ? await interaction.fetchReply() : msg;
      const filter = i => {
        return i.message.id === reply.id && i.deferUpdate() && i.user.id === (interaction.type === 2 ? interaction.user : interaction.author).id;
      };

      var collector = (interaction.type === 2 ? interaction.channel : msg).createMessageComponentCollector({ filter, time: 1800000 });

      collector.on('collect', async int => {

        let collectedOption = row.components[0].options.find(selectMenuOption => selectMenuOption.data.value == int.values.toString());
        row.components[0].setPlaceholder(`${collectedOption.data.emoji?.name || "ğŸ“˜"} ${collectedOption.data.label.replaceAll("á²¼", '')}`);

        if (interaction.type === 2) {
          interaction.editReply({ embeds: [embedMaps[int.values.toString()]], components: [row] });
          //.catch(() => { });
        } else {
          msg.edit({ embeds: [embedMaps[int.values.toString()]], components: [row] });
          //.catch(() => { });
        }

      });

      collector.on('end', collected => {

        if (interaction.type === 2)
          return interaction.editReply({ components: [] }).catch(() => { });
        else
          return msg.edit({ components: [] }).catch(() => { });

      });

    });

  }
};