]> us-delaporte.pagekite.me Git - matrix-shop-bot.git/commitdiff
Fixup
authorEdward Delaporte <edward@delaporte.us>
Sun, 29 Mar 2026 16:16:11 +0000 (11:16 -0500)
committerEdward Delaporte <edward@delaporte.us>
Sun, 29 Mar 2026 16:16:11 +0000 (11:16 -0500)
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])
     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:])
 
     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)
     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
         for item in items:
             results.append(str(item))
         return results