<commit_before>/*****************
* Reports Plugin *
* Credits: jd    *
*****************/
var fs = require('fs');

var Reports = {};
function loadReports() {
	try {
		Reports = JSON.parse(fs.readFileSync('config/reports.json'));
	} catch (e) {
		Reports = {};
	}
}
loadReports();

function saveReports() {
	for (var u in Object.keys(Reports)) {
		var currentReport = Reports[Object.keys(Reports)[u]];
		var seconds = Math.floor(((Date.now() - currentReport.reportTime) / 1000));
		var minutes = Math.floor((seconds / 60));
		var hours = Math.floor((minutes / 60));
		if (hours > 12) delete Reports[currentReport];
	}
	fs.writeFile('config/reports.json', JSON.stringify(Reports));
}

function pmUpperStaff(message) {
    for (var u in Users.users) {
        if (Users.users[u].group === '~' || Users.users[u].group === '&') {
            Users.users[u].send('|pm|~Report Notification|' + Users.users[u].group + Users.users[u].name + '| ' + message);
        }
    }
}

exports.commands = {
	report: 'requesthelp',
	requesthelp: function (target, room, user) {
		if (user.can('pban')) return this.parse('/reports ' + (target || ''));
		if (!this.canTalk()) return this.errorReply("You can't use this command while unable to speak.");
		if (!target) return this.errorReply("Usage: /requesthelp [message] - Requests help from Senior Staff. Please remember to include as much detail as possible with your request.");
		if (target.length < 1) return this.errorReply("Usage: /requesthelp [message] - Requests help from Senior Staff. Please remember to include as much detail as possible with your request.");

		var reportId = (Object.size(Reports) + 1);
		while (Reports[reportId]) reportId--;
		Reports[reportId] = new Object();
		Reports[reportId].reporter = user.name;
		Reports[reportId].message = target.trim();
		Reports[reportId].id = reportId;<commit_msg>Add some aliases to /report<commit_after>/*****************
* Reports Plugin *
* Credits: jd    *
*****************/
var fs = require('fs');

var Reports = {};
function loadReports() {
	try {
		Reports = JSON.parse(fs.readFileSync('config/reports.json'));
	} catch (e) {
		Reports = {};
	}
}
loadReports();

function saveReports() {
	for (var u in Object.keys(Reports)) {
		var currentReport = Reports[Object.keys(Reports)[u]];
		var seconds = Math.floor(((Date.now() - currentReport.reportTime) / 1000));
		var minutes = Math.floor((seconds / 60));
		var hours = Math.floor((minutes / 60));
		if (hours > 12) delete Reports[currentReport];
	}
	fs.writeFile('config/reports.json', JSON.stringify(Reports));
}

function pmUpperStaff(message) {
    for (var u in Users.users) {
        if (Users.users[u].group === '~' || Users.users[u].group === '&') {
            Users.users[u].send('|pm|~Report Notification|' + Users.users[u].group + Users.users[u].name + '| ' + message);
        }
    }
}

exports.commands = {
    complain: 'requesthelp',
    bitch: 'requesthelp',
	report: 'requesthelp',
	requesthelp: function (target, room, user) {
		if (user.can('pban')) return this.parse('/reports ' + (target || ''));
		if (!this.canTalk()) return this.errorReply("You can't use this command while unable to speak.");
		if (!target) return this.errorReply("Usage: /requesthelp [message] - Requests help from Senior Staff. Please remember to include as much detail as possible with your request.");
		if (target.length < 1) return this.errorReply("Usage: /requesthelp [message] - Requests help from Senior Staff. Please remember to include as much detail as possible with your request.");

		var reportId = (Object.size(Reports) + 1);
		while (Reports[reportId]) reportId--;
		Reports[reportId] = new Object();
		Reports[reportId].reporter = user.name;
		Reports[reportId].message = target.trim();
		Reports[reportId].id = reportId;
{'fraction_non_alphanumeric': 0.17992073976221928, 'fraction_numerical': 0.006340819022457068, 'mean_word_length': 4.1580381471389645, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7210958', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1169, 'n_words': 311}