X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-fridge-bot.git/blobdiff_plain/352468b3659be839c23529e0a341b5a026c28e0e..refs/heads/main:/matrix_fridge_bot/bot.py?ds=sidebyside diff --git a/matrix_fridge_bot/bot.py b/matrix_fridge_bot/bot.py index 3afcf91..ff6a5e6 100644 --- a/matrix_fridge_bot/bot.py +++ b/matrix_fridge_bot/bot.py @@ -1,8 +1,8 @@ ''' -Prefix: !fridge +Prefix: .fridge Synax: -!fridge COMMAND ARGS +.fridge COMMAND ARGS Commands: add - add an item @@ -30,7 +30,7 @@ class FridgeBot(): bot_name, bot_pwd, db_file=None, - bot_prefix='!fridge'): + bot_prefix='.fridge'): logging.basicConfig(filename=f'matrix-{MODULE}-bot.log', encoding='utf-8', level=logging.DEBUG) @@ -52,9 +52,16 @@ class FridgeBot(): if match.prefix(): try: result_lines = await self._handle_match(match) + + message_lines = [] for line in result_lines: - await self.bot.api.send_text_message( - room.room_id, str(line)) + message_lines.append(str(line)) + + message = '\n'.join(message_lines) + + await self.bot.api.send_text_message( + room.room_id, message) + except Exception as ex: line = f'Ye flask must be load bearing, or something... {str(ex)}' await self.bot.api.send_text_message(