1
0

Add raw support for get_tasks function

This commit is contained in:
Akbar Rahman 2018-07-11 19:54:58 +01:00
parent e62257daaa
commit f3ea3a108b
Signed by: alvierahman90
GPG Key ID: 20609519444A1269

5
bot.py
View File

@ -98,7 +98,7 @@ def set_property(property_name, value, chat_id):
info_dict = file.write(json.dumps(info_dict))
def get_tasks(chat_id):
def get_tasks(chat_id, raw=False):
with open(config['tasks_file']) as file:
tasks_dict = json.loads(file.read())
@ -110,6 +110,9 @@ def get_tasks(chat_id):
if chat_id not in tasks_dict:
tasks_dict[chat_id] = ""
if raw:
return tasks_dict[chat_id]
tasks = []
for i in tasks_dict[chat_id].split('\n'):
tasks.append(Task(i))