From 2ae79927c27860c2553813543670b54d29cf5bf3 Mon Sep 17 00:00:00 2001 From: aaron crate Date: Mon, 30 Sep 2024 05:51:02 +0000 Subject: [PATCH] sorted products --- garfbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/garfbot.py b/garfbot.py index d954fda..fdc6b22 100644 --- a/garfbot.py +++ b/garfbot.py @@ -232,7 +232,7 @@ async def on_message(message): products = product_query['data'] sorted_products = sorted(products, key=lambda item: item['items'][0]['price']['regular']) response = f"Prices for `{product}` at `{store_name}` near `{zipcode}`:\n" - for item in products: + for item in sorted_products: product_name = item['description'] price = item['items'][0]['price']['regular'] response += f"- `${price}`: {product_name}: \n"