<commit_before>const client = require('./../../');
const utils = require('./../../utils.js');

const regex = /\w+/;

module.exports.info = {
	name: 'Clean messages by MSS',
	category: 'utilities',
	aliases: [
		'clean',
		'prune'
	]
};

module.exports.command = (message) => {
	if (utils.isadmin(message.member)) {
		const prune = message.input ? regex.exec(message.input) : client.user.id;
		message.channel.getMessages().then((messages) => {
			messages.filter((msg) => {
				if (prune === 'bots') {
					return msg.author.bot;
				}
				return msg.author.id === prune;
			}).forEach((msg) => {
				msg.delete().catch(() => {
					console.log('Insufficient permissions (probably)');
				});
			});
		});
	} else {
		message.channel.createMessage('You do not have permission to perform this command!');
	}
};<commit_msg>try not to catch anything<commit_after>const client = require('./../../');
const utils = require('./../../utils.js');

module.exports.info = {
	name: 'Clean messages by MSS',
	category: 'utilities',
	aliases: [
		'clean',
		'prune'
	]
};

module.exports.command = (message) => {
	console.log(message.input);
	if (utils.isadmin(message.member)) {
		const regex = /\w+/g;
		let fail = false;

		const input = regex.exec(message.input);
		console.dir(input);
		let prune = '';

		if (input && input[0] && message.input) {
			prune = input[0];
		} else {
			prune = client.user.id;
		}

		console.log(prune);
		message.channel.getMessages().then((messages) => {
			messages.filter((msg) => {
				if (prune === 'bots') {
					return msg.author.bot;
				}
				return msg.author.id === prune;
			}).forEach((msg) => {
				msg.delete();
			});
		});
	} else {
		message.channel.createMessage('You do not have permission to perform this command!');
	}
};
{'fraction_non_alphanumeric': 0.20385050962627407, 'fraction_numerical': 0.0011325028312570782, 'mean_word_length': 3.1381733021077283, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '4606802', 'n_tokens_mistral': 680, 'n_tokens_neox': 596, 'n_words': 124}