]> us-delaporte.pagekite.me Git - matrix-goal-bot.git/blobdiff - bot.py
Add task
[matrix-goal-bot.git] / bot.py
diff --git a/bot.py b/bot.py
index 0ac709e8083715e89e4fbe441d0b076c3f981634..731113d2c053a9db0047298683dd752aff315e5c 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -40,7 +40,7 @@ async def do_goal(match):
     if match.command('add'):
         new = ' '.join(match.args()[1:])
         result = Data().add_goal(new)
     if match.command('add'):
         new = ' '.join(match.args()[1:])
         result = Data().add_goal(new)
-        return [result]
+        return [f'Goal added with id {result}']
 
     if match.command('list'):
         goals = Data().list_goals()
 
     if match.command('list'):
         goals = Data().list_goals()
@@ -50,8 +50,10 @@ async def do_goal(match):
         return results
 
     if match.command('add-task'):
         return results
 
     if match.command('add-task'):
-        result = Data().add_task(goal_id=goal_id, name=name)
-        return [result]
+        goal_id = int(match.args()[1])
+        new = ' '.join(match.args()[2:])
+        result = Data().add_task(goal_id=goal_id, name=new)
+        return [f'Added task with id {result}']
 
     if match.command('print'):
         goal_id = int(match.args()[1])
 
     if match.command('print'):
         goal_id = int(match.args()[1])