<commit_before>const npmapi = require('api-npm');
const config = require('../config.js');
const utils = require('../utils.js');

var oneDay = 24*60*60*1000; // hours*minutes*seconds*milliseconds

exports.run = function (message, lang) {
  var embed = utils.generateDekuDiv(message);
  var args = message.content.match(utils.expression)[2].split(' ');
  if (message.content.match(utils.expression)[2]) {
    message.channel.startTyping();
    npmapi.getdetails(args.join('-'), data => {
      if (data.name) {
        embed.setColor(config.colors.npm);
        embed.setAuthor(data.name, 'https://i.imgur.com/24yrZxG.png', 'https://www.npmjs.com/package/' + data.name);
        embed.setDescription(data.description + '\nhttps://www.npmjs.com/package/' + data.name + '\n\n`npm install --save ' + data.name + '`');
      } else {
        embed.setColor(config.colors.error);
        embed.setTitle(lang.commands.npm.package_not_found);
        embed.setDescription(`${lang.commands.npm.package_not_found_desc}\n\n${lang.usage} \`${lang.commands.npm. _usage}\`\n${lang.example} \`${lang.commands.npm._example}\``);
      }
      message.channel.send({embed});
      message.channel.startTyping();
    });
  } else {
    embed.setColor(config.colors.error);
    embed.setTitle(lang.commands.npm.no_args);
    embed.setDescription(`\u200b\n${lang.usage} \`${lang.commands.npm. _usage}\`\n${lang.example} \`${lang.commands.npm._example}\``);
    message.channel.send({embed});
  }
};
<commit_msg>Quick infinite typing fix<commit_after>const npmapi = require('api-npm');
const config = require('../config.js');
const utils = require('../utils.js');

var oneDay = 24*60*60*1000; // hours*minutes*seconds*milliseconds

exports.run = function (message, lang) {
  var embed = utils.generateDekuDiv(message);
  var args = message.content.match(utils.expression)[2].split(' ');
  if (message.content.match(utils.expression)[2]) {
    message.channel.startTyping();
    npmapi.getdetails(args.join('-'), data => {
      if (data.name) {
        embed.setColor(config.colors.npm);
        embed.setAuthor(data.name, 'https://i.imgur.com/24yrZxG.png', 'https://www.npmjs.com/package/' + data.name);
        embed.setDescription(data.description + '\nhttps://www.npmjs.com/package/' + data.name + '\n\n`npm install --save ' + data.name + '`');
      } else {
        embed.setColor(config.colors.error);
        embed.setTitle(lang.commands.npm.package_not_found);
        embed.setDescription(`${lang.commands.npm.package_not_found_desc}\n\n${lang.usage} \`${lang.commands.npm. _usage}\`\n${lang.example} \`${lang.commands.npm._example}\``);
      }
      message.channel.stopTyping();
      message.channel.send({embed});
    });
  } else {
    embed.setColor(config.colors.error);
    embed.setTitle(lang.commands.npm.no_args);
    embed.setDescription(`\u200b\n${lang.usage} \`${lang.commands.npm. _usage}\`\n${lang.example} \`${lang.commands.npm._example}\``);
    message.channel.stopTyping();
    message.channel.send({embed});
  }
};

{'fraction_non_alphanumeric': 0.19801652892561983, 'fraction_numerical': 0.011239669421487603, 'mean_word_length': 3.6339969372128635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4904157', 'n_tokens_mistral': 1060, 'n_tokens_neox': 1009, 'n_words': 122}