<commit_before>import Promise from 'bluebird';

const request = Promise.promisify(require('request'));

function fact(client, evt, suffix, lang) {
  evt.message.channel.sendTyping();

  if (suffix === 'cat' || suffix === 'cate' || suffix === 'cats') {
    const options = {
      method: 'GET',
      url: 'http://catfacts-api.appspot.com/api/facts',
      json: true,
      qs: {
        format: 'json'
      }
    };

    return request(options)
      .then(response => {
        return Promise.resolve(response.body.facts);
      });
  }
}

export default {
  fact,
  catfact: fact
};

export const help = {
  fact: {
    parameters: ['text']
  }
};<commit_msg>Dog facts<commit_after>import Promise from 'bluebird';

const request = Promise.promisify(require('request'));

function fact(client, evt, suffix, lang) {
  evt.message.channel.sendTyping();

  let apiUrl = '';

  switch(suffix) {
    case 'cat':
         'cate':
         'cats':
        apiUrl = 'http://catfacts-api.appspot.com/api/facts';
        break;
    case 'dog':
         'dogo':
         'doge':
         'pug':
         'dogs':
        apiUrl = 'https://dog-api.kinduff.com/api/facts';
        break;
    default:
        return Promise.resolve('Sorry, I don\'t know any facts about '+suffix+' :neutral_face');
  }

  const options = {
    method: 'GET',
    url: apiUrl,
    json: true,
    qs: {
      format: 'json'
    }
  };

  return request(options)
    .then(response => {
      return Promise.resolve(response.body.facts);
    });
}

export default {
  fact,
  catfact: fact
};

export const help = {
  fact: {
    parameters: ['text']
  }
};
{'fraction_non_alphanumeric': 0.16216216216216217, 'fraction_numerical': 0.0, 'mean_word_length': 2.4008350730688934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '5292999', 'n_tokens_mistral': 557, 'n_tokens_neox': 535, 'n_words': 118}