Typos and cosmetics.

This commit is contained in:
2023-05-08 10:28:26 +03:00
parent 8debb0b3d5
commit d1f7019f89
3 changed files with 11 additions and 9 deletions

View File

@@ -1,24 +1,24 @@
msg = self.MESSAGE["text"].lower()
responce_given = False
response_given = False
for file in os.listdir(self.path + "db/"):
if responce_given:
if response_given:
break
try:
criteria = json.loads( readfile(self.path + "db/" + file) )
criteria = json.loads(readfile(self.path + "db/" + file))
for wordset in criteria["trigger_lists"]:
for word_set in criteria["trigger_lists"]:
all_words_in = True
for word in wordset:
for word in word_set:
if word not in msg:
all_words_in = False
break
if all_words_in:
self.RESPONSE = criteria["responce_text"]
responce_given = True
self.RESPONSE = criteria["response_text"]
response_given = True
break
except Exception as e: