]> apps.delaporte.us Git - matrix-shop-bot.git/commitdiff
Update to print list after buying something
authorEdward Delaporte <edward@delaporte.us>
Sun, 5 Apr 2026 15:16:14 +0000 (10:16 -0500)
committerEdward Delaporte <edward@delaporte.us>
Sun, 7 Jun 2026 00:29:20 +0000 (19:29 -0500)
matrix_shop_bot/bot.py
matrix_shop_bot/db.py

index 1bd27334d35c42ba8383b37e2fe765396332911e..387cf184af205789ef5e4a919701166600df73ed 100644 (file)
@@ -91,7 +91,10 @@ async def do_shop(match):
     if match.command('buy'):
         item_id = ' '.join(match.args()[1:])
         Data().purchase_item(item_id)
-        return ['Success']
+        results = []
+        for item in Data().get_last_shopping_list():
+            results.append(str(item))
+        return results
 
     if match.command('clear'):
         store_id = ' '.join(match.args()[1:])
index 58bb4ff29a8f0182c0a6381c10e76a681b1a5ca8..6f29260d7be08e8276cb0766b4c7a13cc3cd2d29 100644 (file)
@@ -44,10 +44,6 @@ class Store(SQLModel, table=True):
     def __str__(self):
         return f'{self.name} (#{self.id})'
 
-
-
-
-
 # May get used later...
 #class PurchaseRecord(SQLModel, table=True):
 #    id: int | None = Field(default=None, primary_key=True)