1
0

Add way to export tasks as raw text (no numbering, shows all tasks unfiltered)

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

13
bot.py
View File

@ -48,6 +48,8 @@ def on_message(msg):
do_tasks(arguments, chat_id)
elif command == '/undo':
undo_tasks(arguments, chat_id)
elif command == '/export':
export_tasks(chat_id)
elif command == '/marco':
marco(chat_id)
else:
@ -214,6 +216,17 @@ def undo_tasks(task_ids, chat_id):
bot.sendMessage(chat_id, "Undid task {0}".format(i))
def export_tasks(chat_id):
text = get_tasks(chat_id, raw=True)
if text == "":
bot.sendMessage(chat_id, "No tasks.")
return
bot.sendMessage(chat_id, "RAW:")
bot.sendMessage(chat_id, text)
return
def marco(chat_id):
bot.sendMessage(chat_id, "Polo")