{"size": 939, "ext": "js", "max_stars_repo_path": "src/discord/commands/cetus.js", "max_stars_repo_name": "MarkNjunge/helix", "max_stars_repo_stars_event_min_datetime": "2020-08-09T00:55:09.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-09T00:55:09.000Z", "max_issues_repo_path": "src/discord/commands/cetus.js", "max_issues_repo_name": "MarkNjunge/helix", "max_issues_repo_issues_event_min_datetime": "2018-08-23T09:19:16.000Z", "max_issues_repo_issues_event_max_datetime": "2019-07-20T23:51:55.000Z", "max_forks_repo_path": "src/discord/commands/cetus.js", "max_forks_repo_name": "MarkNjunge/helix", "max_forks_repo_forks_event_min_datetime": "2018-08-23T08:04:54.000Z", "max_forks_repo_forks_event_max_datetime": "2018-08-23T08:59:57.000Z"}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": 2, "avg_line_length": 22.9024390244, "max_line_length": 74, "alphanum_fraction": 0.5335463259}
const warframe = require("./../../shared/warframe");

module.exports = {
  name: "cetus",
  description: "Returns the current time on and bounties cetus",
  usage: "",
  execute: async message => {
    const cetus = await warframe.worldstate.cetus();

    const fields = [];

    let timeOfDay = "";
    if (cetus.isDay) {
      timeOfDay = "day";
    } else {
      timeOfDay = "night";
    }

    const text = `It is now ${timeOfDay} on Cetus.\nTime left: ${
      cetus.timeLeft
    }`;

    cetus.bounties.forEach(bounty => {
      fields.push({
        name: bounty.type,
        value: `Enemy levels: ${
          bounty.enemyLevels
        }\nRewards: ${bounty.rewardPool
          .toString()
          .replace(/\[|\]/gi, "")
          .replace(/,/gi, ", ")}`,
        inline: true
      });
    });

    await message.channel.send(text, {
      embed: { fields, footer: { text: `Avaiable for ${cetus.expires}` } }
    });
  }
};
