Add way to export tasks as raw text (no numbering, shows all tasks unfiltered)
This commit is contained in:
parent
f3ea3a108b
commit
b7834da8b4
13
bot.py
13
bot.py
@ -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")
|
||||
|
||||
|
Reference in New Issue
Block a user