module.exports = {
  name: "matematik",
  description: "Rastgele matematik iÅŸlemi verir.",
  usage: "matematik",
  aliases: ["mat", "math"],
  category: "Games",
  memberPermissions: [],
  botPermissions: ["SendMessages", "EmbedLinks"],
  nsfw: false,
  cooldown: 3000,
  ownerOnly: false,

  async execute(client, message, args, data) {
    let islem = [];
    let sonuÃ§;

    const topcikbelli = Math.floor(Math.random() * (3 - 1)) + 1;

    if (topcikbelli === 1) islem = "-";
    if (topcikbelli === 2) islem = "+";

    const rakam1 = parseInt((Math.random() * (100 - 1)).toFixed());
    const rakam2 = parseInt((Math.random() * (100 - 1)).toFixed());

    if (islem == "-") sonuÃ§ = rakam1 - rakam2;
    if (islem == "+") sonuÃ§ = rakam1 + rakam2;

    const fixedlisonuÃ§ = sonuÃ§;

    //await message.react('ğŸ‘Œ')

    await message.channel.send({
      embeds: [
        {
          color: client.settings.embedColors.default,
          title: '**Â»** AÅŸaÄŸÄ±daki Soruyu **7 Saniye** iÃ§inde CevaplamalÄ±sÄ±n!',
          description: `\`\`\`${rakam1} ${islem} ${rakam2}\`\`\``,
        }
      ]
    });

    let uwu = false;
    while (!uwu) {
      const filter = m => m.author.id == message.author.id;
      const response = await message.channel.awaitMessages({ filter, max: 1, time: 7000 });

      if (!response.first())
        return message.channel.send({
          embeds: [
            {
              color: client.settings.embedColors.red,
              title: '**Â»** SÃ¼ren Doldu!',
              description: `**â€¢** DoÄŸru cevap: **${fixedlisonuÃ§}**`
            }
          ]
        });

      const choice = response.first().content;

      if (isNaN(choice))
        return message.channel.send({
          embeds: [
            {
              color: client.settings.embedColors.red,
              title: '**Â»** Sadece SayÄ± Belirtmelisin!',
              description: `**â€¢** Hem sence cevabÄ±n bÃ¶yle olmasÄ± mÃ¼mkÃ¼n mÃ¼? Sadece merak ettim.`
            }
          ]
        });

      if (choice != fixedlisonuÃ§)
        return message.channel.send({
          embeds: [
            {
              color: client.settings.embedColors.red,
              title: '**Â»** YanlÄ±ÅŸ Cevap!',
              description: `**â€¢** DoÄŸru cevap **${fixedlisonuÃ§}** olmalÄ±ydÄ±.`
            }
          ]
        });

      //if (choice !== fixedlisonuÃ§) {}
      if (choice == fixedlisonuÃ§) uwu = true;
    }

    await message.channel.send({
      embeds: [
        {
          color: client.settings.embedColors.green,
          title: '**Â»** Tebrikler!',
          description: `**â€¢** DoÄŸru cevap! :tada:`
        }
      ]
    });

  }
};