old_contents: import os
  import json
  
  class Wordfilter:
    def __init__(self):
      # json is in same directory as this class, given by __location__.
      __location__ = os.path.realpath(
          os.path.join(os.getcwd(), os.path.dirname(__file__)))
      with open(os.path.join(__location__, 'badwords.json')) as f:
        self.blacklist = json.loads(f.read())
  
    def blacklisted(self, string):
      test_string = string.lower()
      for badword in self.blacklist:
        if test_string.find(badword) != -1:
          return True
  
      return False
      
    def addWords(self, words):
      self.blacklist.extend(words.lower())
  
    def clearList(self):
      self.blacklist = []
  
new_contents: import os
  import json
  
  class Wordfilter:
    def __init__(self):
      # json is in same directory as this class, given by __location__.
      __location__ = os.path.realpath(
          os.path.join(os.getcwd(), os.path.dirname(__file__)))
      with open(os.path.join(__location__, 'badwords.json')) as f:
        self.blacklist = json.loads(f.read())
  
    def blacklisted(self, string):
      test_string = string.lower()
      for badword in self.blacklist:
        if test_string.find(badword) != -1:
          return True
  
      return False
  
    def addWords(self, words):
      self.blacklist.extend([word.lower() for word in words]])
  
    def clearList(self):
      self.blacklist = []
  
subject: Fix AttributeError: 'list' object has no attribute 'lower'