<commit_before>let co   = require('co')
let fs   = require('fs')
let path = require('path')



/**
 * Directory of commands for the bot.
 * @return {Object}
 */
let commands = {}



// Get the base name of this file
let basename = path.basename(module.filename)

fs
  .readdirSync(__dirname)
  // Get all files that are not this file
  .filter(file => (file.indexOf('.') !== 0) && (file !== basename))
  // Add commands from their directories to the commands object
  .forEach(file => {

    let filePath = __dirname + '/' + file

    if (fs.lstatSync(filePath).isDirectory()) {

      let command = require(filePath)
      commands[file] = {}

      if (command.message) {
        commands[file].message = co.wrap(command.message)
      }

    }

  })



module.exports = commands<commit_msg>:sparkles: [Commands] Partial cleanup.<commit_after>let kingCommand      = requireRoot('bot/commands/king')
let metacoinsCommand = requireRoot('bot/commands/metacoins')
let pingCommand      = requireRoot('bot/commands/ping')



/**
 * Directory of commands for the bot.
 * @return {Object}
 */
let commands = {
  king      : kingCommand,
  metacoins : metacoinsCommand,
  ping      : pingCommand
}



module.exports = commands
{'fraction_non_alphanumeric': 0.13535684987694832, 'fraction_numerical': 0.0008203445447087777, 'mean_word_length': 3.135593220338983, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '770826', 'n_tokens_mistral': 386, 'n_tokens_neox': 363, 'n_words': 99}