{"size": 1203, "ext": "js", "max_stars_repo_path": "commands/casual.js", "max_stars_repo_name": "MLP-VectorClub/PennyCurve", "max_stars_repo_stars_event_min_datetime": "2020-07-03T02:57:35.000Z", "max_stars_repo_stars_event_max_datetime": "2020-07-03T02:57:35.000Z", "max_issues_repo_path": "commands/casual.js", "max_issues_repo_name": "MLP-VectorClub/PennyCurve", "max_issues_repo_issues_event_min_datetime": "2019-12-12T10:19:30.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-17T18:00:13.000Z", "max_forks_repo_path": "commands/casual.js", "max_forks_repo_name": "MLP-VectorClub/PennyCurve", "max_forks_repo_forks_event_min_datetime": "2019-12-12T10:24:58.000Z", "max_forks_repo_forks_event_max_datetime": "2019-12-12T10:24:58.000Z"}
{"max_stars_count": 1, "max_issues_count": 6, "max_forks_count": 1, "avg_line_length": 38.8064516129, "max_line_length": 205, "alphanum_fraction": 0.6658354115}
const
  Command = require('../classes/Command'),
  Server = require('../classes/Server'),
  channelNames = require('../channel-names'),
  moment = require('moment');

module.exports = new Command({
  name: 'casual',
  help: () => `Politely asks everyone in the room to move to the ${Server.mention(Server.findChannel(channelNames.CASUAL))} channel (does nothing in said channel)`,
  perm: 'everyone',
  usage: [true],
  allowPM: false,
  action: args => {
    if (args.channel.name === channelNames.CASUAL)
      return Server.wipeMessage(args.message);

    let possible_images = [
        'mountain', // Original by DJDavid98
        'coco',		  // Coco & Rarity by Pirill
        'abcm',     // Applebloom's new CM by Drakizora
        'abfall',   // Applebloom falling by Drakizora
        'abfloat',  // CMs floating around Applebloom by Drakizora
      ],
      image_count = possible_images.length,
      k = moment().minutes() % image_count;

    Server.wipeMessage(args.message);
    Server.send(args.channel, `Please continue this discussion in ${Server.mention(Server.findChannel(channelNames.CASUAL))}\n${process.env.FRONTEND_BASE_URL}img/discord/casual/${possible_images[k]}.png`);
  },
});
