'use strict';

const Command = require('../../models/Command.js');
const EventEmbed = require('../../embeds/ConstructionEmbed.js');

/**
 * Displays the current simaris target
 */
class Construction extends Command {
  /**
   * Constructs a callable command
   * @param {Genesis} bot  The bot object
   */
  constructor(bot) {
    super(bot, 'warframe.worldstate.construction', 'construction', 'Display current construction progress.');
    this.regex = new RegExp(`^${this.call}(?:\\s+on\\s+([pcsxb14]{2,3}))?$`, 'i');
  }

  async run(message) {
    const platformParam = message.strippedContent.match(this.regex)[1];
    const platform = platformParam || await this.settings
      .getChannelSetting(message.channel, 'platform');
    const ws = await this.bot.worldStates[platform.toLowerCase()].getData();
    const embed = new EventEmbed(this.bot, ws.constructionProgress, platform.toUpperCase());
    await this.messageManager.embed(message, embed, true, true);
    return this.messageManager.statuses.SUCCESS;
  }
}

module.exports = Construction;

@@ -537,16 +537,21 @@
 (message
+, ctx
 ) %7B%0A    
@@ -660,79 +660,20 @@
  %7C%7C 
-await this.settings%0A      .getChannelSetting(message.channel, '
+ctx.
 platform
 ');%0A
@@ -668,18 +668,16 @@
 platform
-')
 ;%0A    co

use context