<commit_before>'use strict';

const sprintf = require('sprintf');

module.exports = (srcPath) => {
  
  const Broadcast = require(srcPath + 'Broadcast');
  const CommandType = require(srcPath + 'CommandType');

  return {
    aliases: ['channels'],
    command: (state) => (args, player) => {

      // print standard commands
      Broadcast.sayAt(player, "<bold><white>                  Commands</bold></white>");
      Broadcast.sayAt(player, "<bold><white>===============================================</bold></white>");

      let i = 0;
      for (let [ name , command ] of state.CommandManager.commands) {
        // hide "private" commands
        if (name[0] === '_') {
          continue;
        }

        Broadcast.at(player, sprintf("%-20s", name));
        if (++i % 3 === 0) {
          Broadcast.sayAt(player, '');
        }
      }
      // append another line if need be
      if ((i - 1) % 3 !== 0) {
        Broadcast.sayAt(player, '');
      }

      // channels
      Broadcast.sayAt(player, '');
      Broadcast.sayAt(player, "<bold><white>                  Channels</bold></white>");
      Broadcast.sayAt(player, "<bold><white>===============================================</bold></white>");

      i = 0;
      for (let [ name , command ] of state.ChannelManager.channels) {
        // hide "private" commands
        if (name[0] === '_') {
          continue;
        }

        Broadcast.at(player, sprintf("%-20s", name));
        if (++i % 3 === 0) {
          Broadcast.sayAt(player, '');
        }
      }

      // append another line if need be
      if ((i - 1) % 3 !== 0) {
        Broadcast.sayAt(player, '');
      }
    }
  };
};<commit_msg>commands: always end with a line break (#93)<commit_after>'use strict';

const sprintf = require('sprintf');

module.exports = (srcPath) => {
  
  const Broadcast = require(srcPath + 'Broadcast');
  const CommandType = require(srcPath + 'CommandType');

  return {
    aliases: ['channels'],
    command: (state) => (args, player) => {

      // print standard commands
      Broadcast.sayAt(player, "<bold><white>                  Commands</bold></white>");
      Broadcast.sayAt(player, "<bold><white>===============================================</bold></white>");

      let i = 0;
      for (let [ name , command ] of state.CommandManager.commands) {
        // hide "private" commands
        if (name[0] === '_') {
          continue;
        }

        Broadcast.at(player, sprintf("%-20s", name));
        if (++i % 3 === 0) {
          Broadcast.sayAt(player, '');
        }
      }
      // append another line if need be
      if ((i - 1) % 3 !== 0) {
        Broadcast.sayAt(player, '');
      }

      // channels
      Broadcast.sayAt(player, '');
      Broadcast.sayAt(player, "<bold><white>                  Channels</bold></white>");
      Broadcast.sayAt(player, "<bold><white>===============================================</bold></white>");

      i = 0;
      for (let [ name , command ] of state.ChannelManager.channels) {
        // hide "private" commands
        if (name[0] === '_') {
          continue;
        }

        Broadcast.at(player, sprintf("%-20s", name));
        if (++i % 3 === 0) {
          Broadcast.sayAt(player, '');
        }
      }

      // end with a line break
      Broadcast.sayAt(player, '');
    }
  };
};
{'fraction_non_alphanumeric': 0.22557514191813566, 'fraction_numerical': 0.010457125784284434, 'mean_word_length': 2.1407129455909946, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 41, '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': '4615011', 'n_tokens_mistral': 1028, 'n_tokens_neox': 979, 'n_words': 213}