<commit_before>const discord = require("discord.js")
const fs = require("fs")
const natural = require("natural")
const settings = require("./settings")
const matchingData = require("./matchingdata")

//The bot used to communicate with discord
const bot = new discord.Client();

//All the modules of the bot associated to their ID (folder name)
var modules = {}

//When the bot is ready
bot.on('ready',() => {
	console.info("Client ready")
})

//When a message is send on the channels
bot.on('message',(message) => {
	//Abort if the author is not the bot himself
	if(bot.user.id == message.author.id)
		return
	//If the channel name match the specified channel in the settings or a private channel
	if(!message.channel.type == 'dm' && settings.onlyChannel && message.channel.name != settings.channel)
		return
	//Abort if the mention is not present (only when the property is defined in the settings)
	if(!message.channel.type == 'dm' && settings.onlyMention && !message.mentions.users.get(bot.user.id))
		return
	message.contentWithoutMentions = message.content.replace(/<@.+>/g, '');
	//Test each module grammar for the current message
	var bestMatch = null
	for (var i = 0; i<Object.keys(modules).length; i++) {
		var module = modules[Object.keys(modules)[i]]
		//Check if the module have grammar
		if(module.grammar){
			//Check all the grammar lines of the module
			for(var y = 0; y<module.grammar.length; y++){
				var matchingValue = natural.JaroWinklerDistance(message.contentWithoutMentions,module.grammar[y])
				if(bestMatch == null || bestMatch.value < matchingValue){
					bestMatch = {module,method:matchingData.MatchingMethod.GRAMMAR,evaluated:message.contentWithoutMentions,value:matchingValue,grammarString:module.grammar[y]}
				}
			}
		}

		if(module.regexes){<commit_msg>Fix : parler dans les autres salons<commit_after>const discord = require("discord.js")
const fs = require("fs")
const natural = require("natural")
const settings = require("./settings")
const matchingData = require("./matchingdata")

//The bot used to communicate with discord
const bot = new discord.Client();

//All the modules of the bot associated to their ID (folder name)
var modules = {}

//When the bot is ready
bot.on('ready',() => {
	console.info("Client ready")
})

//When a message is send on the channels
bot.on('message',(message) => {
	//Abort if the author is not the bot himself
	if(bot.user.id == message.author.id)
		return
	//If the channel name match the specified channel in the settings or a private channel
	if(message.channel.type != 'dm' && settings.onlyChannel && message.channel.name != settings.channel)
		return
	//Abort if the mention is not present (only when the property is defined in the settings)
	if(message.channel.type != 'dm' && settings.onlyMention && !message.mentions.users.get(bot.user.id))
		return
	message.contentWithoutMentions = message.content.replace(/<@.+>/g, '');
	//Test each module grammar for the current message
	var bestMatch = null
	for (var i = 0; i<Object.keys(modules).length; i++) {
		var module = modules[Object.keys(modules)[i]]
		//Check if the module have grammar
		if(module.grammar){
			//Check all the grammar lines of the module
			for(var y = 0; y<module.grammar.length; y++){
				var matchingValue = natural.JaroWinklerDistance(message.contentWithoutMentions,module.grammar[y])
				if(bestMatch == null || bestMatch.value < matchingValue){
					bestMatch = {module,method:matchingData.MatchingMethod.GRAMMAR,evaluated:message.contentWithoutMentions,value:matchingValue,grammarString:module.grammar[y]}
				}
			}
		}

		if(module.regexes){
{'fraction_non_alphanumeric': 0.13124306326304105, 'fraction_numerical': 0.0011098779134295228, 'mean_word_length': 4.5038167938931295, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '2284074', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1068, 'n_words': 330}