Commit 0d8d59eb authored by Tulir Asokan's avatar Tulir Asokan 🐈

Fix incorrect html pong message and bump version to 1.3.1

parent e5454924
......@@ -39,11 +39,11 @@ class EchoBot(Plugin):
async def ping_handler(self, evt: MessageEvent, message: str = "") -> None:
diff = int(time() * 1000) - evt.timestamp
pretty_diff = self.prettify_diff(diff)
message = f'"{message[:20]}" took' if message else "took"
text_message = f'"{message[:20]}" took' if message else "took"
html_message = f'"{escape(message[:20])}" took' if message else "took"
content = TextMessageEventContent(
msgtype=MessageType.NOTICE, format=Format.HTML,
body=f"{evt.sender}: Pong! (ping {message} {pretty_diff} to arrive)",
body=f"{evt.sender}: Pong! (ping {text_message} {pretty_diff} to arrive)",
formatted_body=f"<a href='{evt.sender}'>{evt.sender}</a>: Pong! "
f"(<a href='{evt.room_id}/{evt.event_id}'>ping</a> {html_message} "
f"{pretty_diff} to arrive)")
maubot: 0.1.0
id: xyz.maubot.echo
version: 1.3.0
version: 1.3.1
license: MIT
- echo
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment