]> us-delaporte.pagekite.me Git - matrix-goal-bot.git/blobdiff - matrix_goal_bot/bot.py
Allow renaming goals
[matrix-goal-bot.git] / matrix_goal_bot / bot.py
index 9e0b87839a8f2c75d8efb964f74b66c01ebc89d0..97f9bd7754694e6697427e86811943103ba3d7d9 100644 (file)
@@ -160,6 +160,16 @@ async def do_goal(match):
         results = pretty_print(vision, goals)
         return results
 
         results = pretty_print(vision, goals)
         return results
 
+
+    if match.command('rename'):
+        goal_id = int(match.args()[1])
+        name = ' '.join(match.args()[2:])
+        Data().rename_goal(goal_id=goal_id, name=name)
+        goal,tasks = Data().get_goal(goal_id)
+        results = pretty_print(goal, tasks)
+        return results
+
+    # Help text
     return [do_goal.__doc__]
 
 async def goal_bot(room, message, bot):
     return [do_goal.__doc__]
 
 async def goal_bot(room, message, bot):