Fixed path issues

This commit is contained in:
Remy Moll 2020-12-10 11:36:43 +01:00
parent bfd087a0a6
commit cd13cea967
2 changed files with 5 additions and 6 deletions

View File

@ -245,9 +245,9 @@ class ChatBot():
self.persistence.write("log",[])
return "Log cleared"
elif "system" in args:
send_text = self.persistence.read_ext_file("log.txt")
send_text = self.persistence.read_ext_file("persistence/log.txt")
return send_text
send_text = ""
for event in self.persistence.read("log"):
send_text += event + "\n"

View File

@ -77,8 +77,7 @@ class Variables():
"""returns content of given file"""
if not os.path.exists(path):
return "File does not exist"
file = os.open(path,"r")
print(os.getcwd())
content = os.read(file)
os.close(file)
file = open(path,"r")
content = file.read()
file.close()
return content