<commit_before>const Confax = require('../bot.js')
const fs = require('fs')
let config = Confax.config

Confax.registerCommand('removebannedword', 'moderator', (message, bot) => {
  let word = message.content.toLowerCase()
  if (word.length <= 0) {
    return
  }
  if (config.bannedWords.includes(word)) {
    config.bannedWords = config.bannedWords.filter(w => w !== word)
    writeConfig(config)
    message.reply('**' + word + '**' + ' has been removed from the banned words list.')
    return
  }
  message.reply('**' + word + '**' + ' does not exist in the banned words list.')
  console.log('The banned words list does not contain: ' + word)
}, ['rbw'], 'Remove a word from the banned words list', '[word to remove]')

function writeConfig (config) {
  fs.writeFileSync('config.json', JSON.stringify(config, null, 4))
}<commit_msg>Fix removebannedwords command to use server-specific config<commit_after>const Confax = require('../bot.js')
const fs = require('fs')

Confax.registerCommand('removebannedword', 'moderator', (message, bot) => {
  let config = Confax.getConfig(message.guild.id)
  let word = message.content.toLowerCase()
  if (word.length <= 0) {
    return
  }
  if (config.bannedWords.includes(word)) {
    config.bannedWords = config.bannedWords.filter(w => w !== word)
    Confax.setConfig(message.guild.id, config)
    message.reply('**' + word + '**' + ' has been removed from the banned words list.')
    return
  }
  message.reply('**' + word + '**' + ' does not exist in the banned words list.')
  console.log('The banned words list does not contain: ' + word)
}, ['rbw'], 'Remove a word from the banned words list', '[word to remove]')

{'fraction_non_alphanumeric': 0.16136772645470907, 'fraction_numerical': 0.001799640071985603, 'mean_word_length': 4.085365853658536, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6787111', 'n_tokens_mistral': 535, 'n_tokens_neox': 528, 'n_words': 150}