X-Git-Url: https://apps.delaporte.us/gitweb/matrix-goal-bot.git/blobdiff_plain/cd798f2e6dcf353a2338dae0d6cefab886dff387..728f8948c8b912423992b41af644e097a57ebd88:/bot.py diff --git a/bot.py b/bot.py index 2891b82..d57358d 100644 --- a/bot.py +++ b/bot.py @@ -36,12 +36,13 @@ async def do_goal(match): add - add a goal add-task ID - add a task under the goal specified by ID add-vision - add a new vision (collection of goals) + close-goal ID - mark goal done by ID + close-vision ID - mark vision as complete by ID done ID - mark task done by ID - goal-done ID - mark goal done by ID list - list incomplete goals list-all - list everything list-done - list completed goals - print ID - print a goal and all tasks + print GOAL_ID - print a goal and all tasks print-vision ID - print a vision and all goals set-vision GOAL_ID VISION_ID- associate GOAL_ID with VISION_ID visions - list incomplete visions @@ -100,13 +101,20 @@ async def do_goal(match): results = pretty_print(vision, goals) return results - if match.command('goal-done'): + if match.command('close-goal'): goal_id = int(match.args()[1]) - Data().complete_goal(goal_id) - goal,tasks = Data().get_goal(goal_id) - results = pretty_print(goal, tasks) + vision_id = Data().complete_goal(goal_id) + vision,goals = Data().get_vision(vision_id) + results = pretty_print(vision, goals) return results - + + if match.command('close-vision'): + vision_id = int(match.args()[1]) + Data().complete_vision(vision_id) + vision,goals = Data().get_vision(vision_id) + results = pretty_print(vision, goals) + return results + if match.command('done'): task_id = int(match.args()[1])