]> apps.delaporte.us Git - matrix-goal-bot.git/blobdiff - matrix_goal_bot/bot.py
Fewer messages when listing.
[matrix-goal-bot.git] / matrix_goal_bot / bot.py
index 6da935199f037714063d15ade222d7652712a9cb..ade650a6fe154ba02033d59a525984dfd3385885 100644 (file)
@@ -90,9 +90,16 @@ class GoalBot():
         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:
                 logger.warn(f'Caught exception: {str(ex)}')
                 dumb_msg_idx = len(str(ex)) % len(snark)