- await client.room_send(
- room_id=self._joined_room_id,
- message_type="m.room.message",
- content={
- "msgtype": "m.text",
- "body": line.rstrip("\n")
- }
- )
+ try:
+ self._input_parser.feed_line(line)
+ except Exception as e:
+ self._log(logging.WARNING, "Error parsing input: %s" % str(e))
+ continue
+ for content in self._input_parser.fetch_decoded():
+ await client.room_send(
+ room_id=self._joined_room_id,
+ message_type="m.room.message",
+ content=content
+ )