<commit_before><commit_msg>awaud<commit_after>/*
* CurrencyChecker
*
* uses the fixer.io API
*
* Contributed by Capuccino
*
 */

exports.commands = [
    'convert'
];

const fx = require('http://openexchangerates.github.io/money.js/money.min.js');

exports.convert = {
    desc: 'converts money, that it',
    usage: '<[number] [Currency Code]> <resulting Currency code>',
    main: (bot, ctx) => {
        return new Promise((resolve, reject) => {
            if (!ctx.suffix | ctx.args) {
                ctx.msg.channel.createMessage('Give me a number then two currencies first.').then(resolve).catch(reject);
            } else if (ctx.args > 4) {
                ctx.msg.channel.createMessage('Insufficient information. I need a number and at least two currencies').then(reject).catch(reject);
            } else {
                fx(ctx.args[1]).from(ctx.args[2]).to(ctx.args[3]);
            }
        });
    }
};
{'fraction_non_alphanumeric': 0.1563517915309446, 'fraction_numerical': 0.004343105320304018, 'mean_word_length': 2.546153846153846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '4614580', 'n_tokens_mistral': 297, 'n_tokens_neox': 285, 'n_words': 62}