<commit_before>'use strict';

const Nexus = require('warframe-nexus-query');
const Command = require('../Command.js');

/**
 * Looks up items from Nexus-stats.com
 */
class PriceCheck extends Command {
  /**
   * Constructs a callable command
   * @param {Genesis} bot  The bot object
   */
  constructor(bot) {
    super(bot, 'misc.pricecheck', 'pricecheck', 'pricecheck');
    this.regex = new RegExp(`^${this.bot.escapedPrefix}p(?:rice)?\\s?c(?:heck)?(?:\\s+([\\w+\\s]+))?`, 'i');

    this.usages = [
      {
        description: 'Display an items worth from nexus-stats.com',
        parameters: ['item'],
      },
    ];

    this.nexusQuerier = new Nexus();
  }

  /**
   * Run the command
   * @param {Message} message Message with a command to handle, reply to,
   *                          or perform an action based on parameters.
   */
  run(message) {
    const item = message.content.match(this.regex)[1];

    this.nexusQuerier.priceCheckQueryAttachment(item)
        .then((result) => {
          let embed = {};
          if (typeof result[0] === 'string') {
            embed = {
              color: 0xff0000,
              title: 'Warframe - Pricecheck',
              url: 'http://nexus-stats.com',
              description: `Pricecheck for: ${item}`,
              thumbnail: {
                url: 'https://cdn.discordapp.com/icons/195582152849620992/4c1fbd47b3e6c8d49b6d2362c79a537b.jpg',
              },
              fields: [
                {
                  name: '_ _',
                  value: result[0],
                  inline: true,
                },
              ],
              footer: {
                icon_url: 'https://cdn.discordapp.com/icons/195582152849620992/4c1fbd47b3e6c8d49b6d2362c79a537b.jpg',
                text: 'Pricechecks provided by Nexus Stats - https://nexus-stats.com',
              },
            };
          } else {
            const attachment = result[0];
            embed = {
              description: `Price query for ${item}`,<commit_msg>added pricecheck color back<commit_after>'use strict';

const Nexus = require('warframe-nexus-query');
const Command = require('../Command.js');

/**
 * Looks up items from Nexus-stats.com
 */
class PriceCheck extends Command {
  /**
   * Constructs a callable command
   * @param {Genesis} bot  The bot object
   */
  constructor(bot) {
    super(bot, 'misc.pricecheck', 'pricecheck', 'pricecheck');
    this.regex = new RegExp(`^${this.bot.escapedPrefix}p(?:rice)?\\s?c(?:heck)?(?:\\s+([\\w+\\s]+))?`, 'i');

    this.usages = [
      {
        description: 'Display an items worth from nexus-stats.com',
        parameters: ['item'],
      },
    ];

    this.nexusQuerier = new Nexus();
  }

  /**
   * Run the command
   * @param {Message} message Message with a command to handle, reply to,
   *                          or perform an action based on parameters.
   */
  run(message) {
    const item = message.content.match(this.regex)[1];

    this.nexusQuerier.priceCheckQueryAttachment(item)
        .then((result) => {
          let embed = {};
          if (typeof result[0] === 'string') {
            embed = {
              color: 0xff0000,
              title: 'Warframe - Pricecheck',
              url: 'http://nexus-stats.com',
              description: `Pricecheck for: ${item}`,
              thumbnail: {
                url: 'https://cdn.discordapp.com/icons/195582152849620992/4c1fbd47b3e6c8d49b6d2362c79a537b.jpg',
              },
              fields: [
                {
                  name: '_ _',
                  value: result[0],
                  inline: true,
                },
              ],
              footer: {
                icon_url: 'https://cdn.discordapp.com/icons/195582152849620992/4c1fbd47b3e6c8d49b6d2362c79a537b.jpg',
                text: 'Pricechecks provided by Nexus Stats - https://nexus-stats.com',
              },
            };
          } else {
            const attachment = result[0];
            embed = {
              description: `Price query for ${item}`,
              color: parseInt(attachment.color, 16),
{'fraction_non_alphanumeric': 0.14135998050207166, 'fraction_numerical': 0.040945649524738, 'mean_word_length': 1.7617765814266486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '634168', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1217, 'n_words': 251}