Skip to content

Commit

Permalink
[template] fix media key
Browse files Browse the repository at this point in the history
  • Loading branch information
david-lev committed Oct 8, 2023
1 parent 468e145 commit 305980c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pywa/types/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ class Document(ComponentABC):
document: str | bytes | BinaryIO

def to_dict(self, is_url: bool) -> dict[str, str]:
return dict(type=self.type.value, document=dict(url=self.document) if is_url else dict(id=self.document))
return dict(type=self.type.value, document=dict(link=self.document) if is_url else dict(id=self.document))

@dataclass(slots=True)
class Image(ComponentABC):
Expand All @@ -916,7 +916,7 @@ class Image(ComponentABC):
image: str | bytes | BinaryIO

def to_dict(self, is_url: bool) -> dict[str, str]:
return dict(type=self.type.value, image=dict(url=self.image) if is_url else dict(id=self.image))
return dict(type=self.type.value, image=dict(link=self.image) if is_url else dict(id=self.image))

@dataclass(slots=True)
class Video(ComponentABC):
Expand All @@ -930,7 +930,7 @@ class Video(ComponentABC):
video: str | bytes | BinaryIO

def to_dict(self, is_url: bool) -> dict[str, str]:
return dict(type=self.type.value, video=dict(url=self.video) if is_url else dict(id=self.video))
return dict(type=self.type.value, video=dict(link=self.video) if is_url else dict(id=self.video))

@dataclass(slots=True)
class Location(ComponentABC):
Expand Down

0 comments on commit 305980c

Please sign in to comment.