msg = self.MESSAGE["text"].lower() responce_given = False for file in os.listdir(self.path + "db/"): if responce_given: break try: criteria = json.loads( readfile(self.path + "db/" + file) ) for wordset in criteria["trigger_lists"]: all_words_in = True for word in wordset: if not word in msg: all_words_in = False break if all_words_in: self.RESPONCE = criteria["responce_text"] responce_given = True break except Exception as e: print("[WARN] module : qna-basic: db file {} raised exception \"{}\"".format(file, e))