Skip to content

Commit

Permalink
[tmp] Provide MSC2530 event content
Browse files Browse the repository at this point in the history
Required until mautrix/python#170 is merged and
pulled into maubot.

Signed-off-by: Joe Groocock <[email protected]>
  • Loading branch information
frebib committed Mar 22, 2024
1 parent 0e6c321 commit ec305fa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion xkcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
Image = None


@dataclass
class MSC2530MediaMessageEventContent(MediaMessageEventContent):
filename: str = None
formatted_body: str = None
format: Format = None


@dataclass
class XKCDInfo(SerializableAttrs):
year: str
Expand Down Expand Up @@ -246,7 +253,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}",
Expand Down

0 comments on commit ec305fa

Please sign in to comment.