<commit_before>'use strict';
exports.info = {
  desc: 'Responds with an 8ball message when asked a question.',
  usage: '<question>',
  aliases: [],
};

const responses = require('../../assets/8ball.json');
const utils = require('../utilities');
const logger = require('winston');
const config = require('../../config');

exports.run = (client, msg, params = []) => new Promise(resolve => {
  // Exit if no 'question' was asked
  if (params.length === 0) {
    logger.debug('No parameters passed to 8ball');
    msg.reply(`\`\`${msg.prefix}8ball <question>\`\``);
    resolve();
    return;
  }
  // Get random response
  let response = responses[utils.getRandomInt(0, responses.length)];
  // If the last character is a '?' do troll response for bot owner
  if (msg.author.id === config.owner_id && params[params.length - 1].endsWith('?')) {
    response = 'Of course!';
  }
  // Reply with an @ mention
  msg.reply(response);
  resolve();
});<commit_msg>8ball usage<commit_after>'use strict';
exports.info = {
  desc: 'Responds with an 8ball message when asked a question.',
  usage: '<question>',
  aliases: [],
};

const responses = require('../../assets/8ball.json');
const utils = require('../utilities');
const config = require('../../config');

exports.run = (client, msg, params = []) => new Promise(resolve => {
  // Exit if no 'question' was asked
  if (params.length === 0) {
    utils.usage(msg, exports.info);
    return resolve();
  }
  // Get random response
  let response = responses[utils.getRandomInt(0, responses.length)];
  // If the last character is a '?' do troll response for bot owner
  if (msg.author.id === config.owner_id && params[params.length - 1].endsWith('?')) {
    response = 'Of course!';
  }
  // Reply with an @ mention
  msg.reply(response);
  return resolve();
});
{'fraction_non_alphanumeric': 0.18438538205980065, 'fraction_numerical': 0.007198228128460687, 'mean_word_length': 3.506234413965087, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, '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': '7345328', 'n_tokens_mistral': 565, 'n_tokens_neox': 550, 'n_words': 164}