Skip to content

Commit

Permalink
Fixed errors when sending empty messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bramenn committed Apr 3, 2023
1 parent cff3f0e commit 8579b12
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions menuflow/nodes/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ async def run(self):

if not self.text:
self.log.warning(f"The message {self.id} hasn't been send because the text is empty")
return

msg_content = TextMessageEventContent(
msgtype=self.message_type,
body=self.text,
format=Format.HTML,
formatted_body=markdown(self.text),
)

await self.send_message(room_id=self.room.room_id, content=msg_content)
else:
msg_content = TextMessageEventContent(
msgtype=self.message_type,
body=self.text,
format=Format.HTML,
formatted_body=markdown(self.text),
)

await self.send_message(room_id=self.room.room_id, content=msg_content)

await self._update_node()

0 comments on commit 8579b12

Please sign in to comment.