X-Git-Url: https://apps.delaporte.us/gitweb/matrix-shop-bot.git/blobdiff_plain/ea1529a8cdc661c83ea50c241a47f578de7d68e5..aa3ac50778f5cfcd643274d07e702b01bb8de7cf:/matrix_shop_bot/bot.py diff --git a/matrix_shop_bot/bot.py b/matrix_shop_bot/bot.py index 9a36c63..02c59bc 100644 --- a/matrix_shop_bot/bot.py +++ b/matrix_shop_bot/bot.py @@ -185,9 +185,16 @@ async def shop_bot(room, message, bot): try: if match.prefix(): result_lines = await do_shop(match) + + message_lines = [] for line in result_lines: - await bot.api.send_text_message( - room.room_id, str(line)) + message_lines.append(str(line)) + + message = '\n'.join(message_lines) + + await bot.api.send_text_message( + room.room_id, message) + except Exception as ex: for line in ['You have:', ' no tea', str(ex)]: await bot.api.send_text_message(