title: I'm Trying to make a word blacklist for discord.js using an sql database
body: <p>I'm currently attempting to create a word blacklist command, I can currently write to the database however I'm having issues pulling the word into an array</p>
  <pre><code>module.exports = {
    name: 'blacklistword',
    description: &quot;Blacklists a word for that server&quot;,
    async execute(client, message, cmd, args, Discord){
  
  if(message.author.id !== '513413045251342336') return;
  
    if(!message.member.permissions.has('ADMINISTRATOR')) return message.channel.send(`Not Enough Permissions to Execute Command`)
    let text = `{'${args[0]}'}`
    let blacklistedWord = await getBlacklist(message, client, args, text)
  
  
  
      if(text){
        if(args[1] === 'remove' || args[1] === 'Remove'){
          if(blacklistedWord){
          client.db.query(`delete from blacklisted_words where guild_id = $1 and text = $2`, [message.guild.id, text])
          message.channel.send(`**${args[0]}** was removed from blacklisted words`)
        } else {
          message.channel.send(`**${args[0]}** is not A blacklisted word`)
        }
          return
        }
  
        try{
          await client.db.query(`insert into blacklisted_words (guild_id, text) values ($1, $2)`, [message.guild.id, text])
          message.channel.send(`**${args[0]}** was added to blacklisted words`)
        } catch (err) {
            message.channel.send(`**${args[0]}** is already a blacklisted words`)
        }
  
      } else {
        message.channel.send('Please add the word you would like to blacklist')
      }
    }
    }
  
  
    async function getBlacklist(message, client, args, text){
    const response = await client.db.query(`select text from blacklisted_words where guild_id = $1 and text = $2`, [message.guild.id, text])
    if(response &amp;&amp; response.rowCount) return response.rows[0].text
    return null;
    }
  </code></pre>
  <p>this is for adding the blacklisted word <code>guild_id</code> is set to Character Varying and <code>text</code> is set to character varying[]</p>
  <p>in my messageCreate.js file I have</p>
  <pre><code> let blacklisted = getBlacklistWord(message, client)
  
  
       let foundInText = false;
       for (var i in blacklisted) {
         if (message.content.toLowerCase().includes(blacklisted[i].toLowerCase())) foundInText = true;
       }
       if (foundInText) {
       if(message.author.bot) {
           return;
          }
         message.delete();
         message.channel.send(`**${message.author.username}** Please Refrain from using blacklisted words`);
       }
  
  async function getBlacklistWord(message, client){
    const response = await client.db.query(`select text from blacklisted_words where guild_id = $1`, [message.guild.id])
    if(response &amp;&amp; response.rowCount) return response.rows[0].text
    return null;
  }
  </code></pre>
  <p>I have the blacklistword command working to add words to the database I'm just having issues with messageCreate grabbing those words to delete them and such, If anyone can help I'll be forever grateful thanks</p>