<commit_before>(function(bdgg) {
    bdgg.passivestalk = (function() {
        var style, cssBody, template, fnHandleCommand;
        cssBody = '{background-color:rgba(18,144,117,0.25);color:rgba(255,255,255,0.8);}';
        template = '.user-msg[data-username="{}"]';
        fnHandleCommand = destiny.chat.handleCommand;

        function PushChat(string) {
            destiny.chat.gui.push(new ChatInfoMessage(string));
        }
        function updatePs(r){
            var psList = r.join(',');
            bdgg.settings.put('bdgg_passive_stalk', psList);
            PushChat("Your passivestalk list has been updated");
            document.querySelector('#bdgg_passive_stalk').value = bdgg.settings.get('bdgg_passive_stalk');
        }
        destiny.chat.handleCommand = function(str) {
            var match, sendstr;
            sendstr = str.trim();
            var r = bdgg.settings.get('bdgg_passive_stalk').split(',');
            if (r.length === 1 && r[0] === '') r = [];

            if (match = sendstr.match(/^(ps|passivestalk)\s(\w+)/)) {
                r.push(match[2]);
                r = r.filter(function(val, idx, self) {
                    return self.indexOf(val) === idx;
                });
                updatePs(r);
            } else if (match = sendstr.match(/^(unps|unpassivestalk)\s(\w+)/)){
                var matchIndex = r.indexOf(match[2]);
                if (matchIndex === -1){
                    PushChat("User not found in your passivestalk list");
                } else {
                    r.splice(matchIndex, 1);
                    updatePs(r);
                }
            } else if (sendstr.match(/^(ps|passivestalk)\s*$/)) {
                if (bdgg.settings.get('bdgg_passive_stalk').length === 0){
                    PushChat("Your passivestalk list is empty");    
                } else {
                    PushChat("Passively stalking the following users: " + bdgg.settings.get('bdgg_passive_stalk').split(',').join(', '));
                }            <commit_msg>Small code changes to /unps<commit_after>(function(bdgg) {
    bdgg.passivestalk = (function() {
        var style, cssBody, template, fnHandleCommand;
        cssBody = '{background-color:rgba(18,144,117,0.25);color:rgba(255,255,255,0.8);}';
        template = '.user-msg[data-username="{}"]';
        fnHandleCommand = destiny.chat.handleCommand;

        function pushChat(string) {
            destiny.chat.gui.push(new ChatInfoMessage(string));
        }
        function updatePassivestalk(psList){
            var psTargets = psList.join(','); //in the settings the names are stored as "user1,user2,user3,..."
            bdgg.settings.put('bdgg_passive_stalk', psTargets);
            pushChat("Your passivestalk list has been updated");
            document.querySelector('#bdgg_passive_stalk').value = psTargets;
        }
        destiny.chat.handleCommand = function(str) {
            var match, sendstr;
            sendstr = str.trim();
            var psList = bdgg.settings.get('bdgg_passive_stalk').split(',');
            if (psList.length === 1 && psList[0] === '') psList = [];

            if (match = sendstr.match(/^(ps|passivestalk)\s(\w+)/)) {
                psList.push(match[2]);
                psList = psList.filter(function(val, idx, self) {
                    return self.indexOf(val) === idx;
                });
                updatePassivestalk(psList);
            } else if (match = sendstr.match(/^(unps|unpassivestalk)\s(\w+)/)){
                var matchIndex = psList.indexOf(match[2]);
                if (matchIndex === -1){
                    pushChat("User not found in your passivestalk list");
                } else {
                    psList.splice(matchIndex, 1);
                    updatePassivestalk(psList);
                }
            } else if (sendstr.match(/^(ps|passivestalk)\s*$/)) {
                if (psList.length === 0){
                    pushChat("Your passivestalk list is empty");    
                } else {
                    pushChat("Passively stalking the following users: " + psList.join(', '));
                }            
{'fraction_non_alphanumeric': 0.1472289156626506, 'fraction_numerical': 0.014698795180722892, 'mean_word_length': 1.8257317903335601, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5265410', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1189, 'n_words': 211}