]> apps.delaporte.us Git - matrix-shop-bot.git/blobdiff - matrix_shop_bot/bot.py
Fixup
[matrix-shop-bot.git] / matrix_shop_bot / bot.py
index 12aaf794fcadac8845ff999522ff7e24c6b19bf6..5c8e6c5eae83f7ffbbc319bf217c2373244e8e14 100644 (file)
@@ -65,8 +65,14 @@ async def do_shop(match):
     if match.command('assign'):
         store_id = int(match.args()[1])
         item_id  = int(match.args()[2])
-        result = Data().assign_store(store_id, item_id)
-        return [result]
+        Data().assign_store(store_id, item_id)
+
+        # Now print the list for the assigned store
+        items = Data().get_shopping_list(store_id)
+        results = ['Shopping List']
+        for item in items:
+            results.append(str(item))
+        return results
 
     if match.command('buy'):
         item_id = ' '.join(match.args()[1:])
@@ -86,6 +92,7 @@ async def do_shop(match):
     if match.command('list'):
         store_id = ' '.join(match.args()[1:])
         items = Data().get_shopping_list(store_id)
+        results = ['Shopping List']
         for item in items:
             results.append(str(item))
         return results