Skip to content

Commit f992dd2

Browse files
authored
fix!: fix json serialization (#588)
* fix!: fix EmbedImageStruct serialization * fix!: Button emoji serialization
1 parent d692810 commit f992dd2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

interactions/api/models/message.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,3 +901,12 @@ def __init__(self, **kwargs):
901901

902902
if self.footer:
903903
self._json.update({"footer": self.footer._json})
904+
905+
if self.video:
906+
self._json.update({"video": self.video._json})
907+
908+
if self.image:
909+
self._json.update({"image": self.image._json})
910+
911+
if self.thumbnail:
912+
self._json.update({"thumbnail": self.thumbnail._json})

interactions/models/component.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ def __init__(self, **kwargs) -> None:
140140
self.type = ComponentType.BUTTON
141141
self.style = ButtonStyle(self.style)
142142
self._json.update({"type": self.type.value, "style": self.style.value})
143+
if self.emoji:
144+
self._json.update({"emoji": self.emoji._json})
143145

144146

145147
class Component(DictSerializerMixin):

0 commit comments

Comments
 (0)