<commit_before>const AbstractCommand = require('./AbstractCommand');
const chalk           = require('chalk');
const _               = require('lodash');
const moment          = require('moment');
const juration        = require('juration');

class RemindCommand extends AbstractCommand {
    static get name() { return 'remind'; }

    static get description() { return "Lets users be reminded of things"; }

    static get help() {
        return `Type remind or remind me with what you want to be reminded with.\n
        \`\`\`$remind me in 50 minutes to check the news\`\`\``;
    }

    handle() {
        this.responds(/^remind( me)?$/, () => {
            this.reply(RemindCommand.help);
        });
        this.responds(/^remind(?: me)? (in|on|to) (.+?) (in|on|to) (.+?)$/m, (matches) => {
            try {

                let type, date, action;
                if (matches[1] === 'in') {
                    date   = moment().add(moment.duration(juration.parse(matches[2]), 'seconds'));
                    action = matches[3];
                } else if (matches[1] === 'on') {
                    date   = moment(matches[2]);
                    action = matches[3];
                } else {
                    action = matches[1];
                    if (matches[3] === 'in') {
                        date = moment().add(moment.duration(juration.parse(matches[3]), 'seconds'));
                    } else {
                        date = moment(matches[4]);
                    }
                }
            } catch (e) {
                this.reply("Sorry, I couldn't understand your reminder");

                return false;
            }


            this.reply("Alright, I'll remind you.");
            this.dispatcher.emit('new_reminder', {action: action, date: date.unix(), user: this.message.author.id});
        });
    }
}

module.exports = RemindCommand;<commit_msg>Fixing reminder<commit_after>const AbstractCommand = require('./AbstractCommand');
const chalk           = require('chalk');
const _               = require('lodash');
const moment          = require('moment');
const juration        = require('juration');

class RemindCommand extends AbstractCommand {
    static get name() { return 'remind'; }

    static get description() { return "Lets users be reminded of things"; }

    static get help() {
        return `Type remind or remind me with what you want to be reminded with.\n
        \`\`\`$remind me in 50 minutes to check the news\`\`\``;
    }

    handle() {
        this.responds(/^remind( me)?$/, () => {
            this.reply(RemindCommand.help);
        });
        this.responds(/^remind(?: me)? (in|on|to) (.+?) (in|on|to) (.+?)$/m, (matches) => {
            console.log(matches);
            try {
                let type, date, action;
                if (matches[1] === 'in') {
                    date   = moment().add(moment.duration(juration.parse(matches[2]), 'seconds'));
                    action = matches[3];
                } else if (matches[1] === 'on') {
                    date   = moment(matches[2]);
                    action = matches[3];
                } else {
                    action = matches[1];
                    if (matches[3] === 'in') {
                        date = moment().add(moment.duration(juration.parse(matches[3]), 'seconds'));
                    } else {
                        date = moment(matches[4]);
                    }
                }

                this.reply("Alright, I'll remind you.");

                this.dispatcher.emit('new_reminder', {action: action, date: date.unix(), user: this.message.author.id});
            } catch (e) {
                this.reply("Sorry, I couldn't understand your reminder");

                return false;
            }
        });
    }
}

module.exports = RemindCommand;
{'fraction_non_alphanumeric': 0.15011727912431588, 'fraction_numerical': 0.006254886630179828, 'mean_word_length': 1.6020338983050848, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7292912', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1001, 'n_words': 251}