From ac8af0fa2de1498e135a18c9f05038c0e96801c1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 22 Mar 2024 21:04:16 +0000 Subject: [PATCH] [tmp] Provide MSC2530 event content Required until https://github.com/mautrix/python/pull/170 is merged and pulled into maubot. Signed-off-by: Joe Groocock --- xkcd.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xkcd.py b/xkcd.py index 7f167e5..dee0b75 100644 --- a/xkcd.py +++ b/xkcd.py @@ -41,6 +41,13 @@ except ImportError: Image = None +@dataclass +class MSC2530MediaMessageEventContent(MediaMessageEventContent): + filename: str = None + formatted_body: str = None + format: Format = None + + @dataclass class XKCDInfo(SerializableAttrs): year: str @@ -245,7 +252,7 @@ async def _send_xkcd(self, room_id: RoomID, xkcd: XKCDInfo) -> None: content["license_url"] = "https://xkcd.com/license.html" await self.client.send_message(room_id, content) else: - content = MediaMessageEventContent( + content = MSC2530MediaMessageEventContent( msgtype=MessageType.IMAGE, format=Format.HTML, external_url=f"https://xkcd.com/{xkcd.num}",