Add image constructor

This commit is contained in:
Folkert Kevelam 2025-08-24 17:58:21 +02:00
parent be105821d9
commit 47dd9bf350

View File

@ -125,3 +125,19 @@ class PString:
't' : 'Str', 't' : 'Str',
'c' : self.content 'c' : self.content
} }
class Image:
def __init__(self, attr, caption, url):
self.attr = attr
self.caption = caption
self.url = url
def toJson(self):
return {
't' : 'Image',
'c' : [
self.attr.toJson(),
self.caption,
[self.url, ""]
]
}