X-Git-Url: https://apps.delaporte.us/gitweb/matrix-shop-bot.git/blobdiff_plain/dc9596331e7950ed257dd0e0ccffd36590ab8cc0..f636eed1859db9f987dd7a0badaee48bb051237f:/matrix_shop_bot/bot.py?ds=sidebyside diff --git a/matrix_shop_bot/bot.py b/matrix_shop_bot/bot.py index 5c8e6c5..f426663 100644 --- a/matrix_shop_bot/bot.py +++ b/matrix_shop_bot/bot.py @@ -82,6 +82,7 @@ async def do_shop(match): if match.command('clear'): store_id = ' '.join(match.args()[1:]) Data().clear_list(store_id) + self.last_store_id = None return ['Success'] if match.command('clear-all'): @@ -91,6 +92,9 @@ async def do_shop(match): if match.command('list'): store_id = ' '.join(match.args()[1:]) + if len(store_id) == 0: + store_id = None + items = Data().get_shopping_list(store_id) results = ['Shopping List'] for item in items: @@ -129,6 +133,9 @@ async def shop_bot(room, message, bot): await bot.api.send_text_message( room.room_id, str(line)) except Exception as ex: - return ['You have:', ' no tea'] + for line in ['You have:', ' no tea']: + await bot.api.send_text_message( + room.room_id, str(line)) +