]> us-delaporte.pagekite.me Git - matrix-goal-bot.git/blobdiff - matrix_goal_bot/bot.py
Rebasing
[matrix-goal-bot.git] / matrix_goal_bot / bot.py
index fd8fdcad380bed6d9e23f56c694f2157958a9cca..37cb90db1a418f2b7a0bbc3c99717b2064687d86 100644 (file)
@@ -10,9 +10,6 @@ SERVER = os.environ.get('MATRIX_SERVER')
 BOT_NAME = os.environ.get('GOAL_BOT')
 BOT_PWD = os.environ.get('GOAL_BOT_PWD')
 
-def get_bot():
-    creds = botlib.Creds(SERVER, BOT_NAME, BOT_PWD)
-    return botlib.Bot(creds)
 
 DATE_FORMAT = '%Y-%m-%d'
 
@@ -177,6 +174,11 @@ async def do_goal(match):
         results = pretty_print(goal, tasks)
         return results
 
+    if match.command('remove'):
+        task_id  = int(match.args()[1])
+        result = Data().remove_task(task_id)
+        return [result]
+
     if match.command('extra.help'):
         return [ex_help]